7 Replies Latest reply: Nov 25, 2016 3:52 PM by Sunny Talwar RSS

    Rolling 3 months in load script only

    prithvi k

      Hi ,

       

      Need help to find rolling 3 months in load script only .

       

      Tried this code  but  peek function gives different values for last 2 months than original column Amount.Time dimension starts from Jul 2015 but still see data for prior month where i expected it to be 0 .

       

      Example: Nov 2015 , expected value is 379080491.56612+395828795.03718+373200829.17296

      but summation is not fetching value expected as in screenshot below.

       

      [IS_QTD]:

      LOAD

             entity,

             time,

            Amount,

            RangeSum(Amount, Peek(Amount,-1), Peek(Amount, -2))     as '3M_Cumulative',

            RangeSum(Amount) as  [0 step],

            RangeSum(Alt(Peek('Amount',-1),0)) as [1 step],

            RangeSum(Alt(Peek('Amount',-2),0)) as [2 step],

           FROM IS_MTD;

       

      Rolling3.PNG

      Thanks,

      Prithvi