Skip to Content
0

Aggrigation of Last n Periods copied in past and current bucket

Mar 14, 2017 at 01:26 PM

82

avatar image

Hello,

There is existing SAP note which shows how to do aggregation of last n periods in current month. I want to have similar calculation for the past buckets. Below is the sample calculation from SAP Note

IF(("PERIODID0" >= "$$PERIODID0CU$$" -6) AND "PERIODID0" < "$$PERIODID0CU$$", "SALESqty@MTHPROD", NULL)

Here "$$PERIODID0CU$$" is referring to current month. What I want to do is do similar calculation from Past bucket, let say start from last year in weekly bucket. So what should I use instead if CU to refer past bucket.

Note: This will be dynamic and rolling calculation starting from past to current bucket.

Regards

Ankur

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Alecsandra Dimofte
Mar 15, 2017 at 10:32 AM
1

Hi Ankur,

Can you try $$PERIODI0CU$$ - 52? Given the PERIODID0 is define for weekly buckets.

  • PERIODID0: Weekly periods
  • PERIODID1: Yearly periods
  • PERIODID2: Quarterly periods
  • PERIODID3: Monthly periods

Best

Alecsandra

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Alecsandra

I have model my calculation as below

IF(("PERIODID0" >= "$$PERIODID0$$" - 53) AND "PERIODID0" < "$$PERIODID0CU$$" , "HROLL11A@WKPRODSALESREGSEAGRP", NULL)

I know this will be valid for current bucket, but will be valid for past bucket also. We have a requirement where we want to calculate value in past bucket and save it in past bucket only.

Regards

Ankur

0