Skip to Content

Aggrigation of Last n Periods copied in past and current bucket

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 15, 2017 at 10:32 AM

    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

    Add comment
    10|10000 characters needed 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