Skip to main content

Hi 

I have a CPI metric which starts from FY2022-23 and goes on till FY 2121-22. I want to create a rolling average of first 25 values starting from FY2022-23 including FY2022-23 plus next 24 years.

Then when it comes to FY2023-24, it does the same thing and include FY2023-24 and the next 24 years. and goes on and on. 

Thanks

Musab

Hi @mmusab 
Accourding to me, by MovingAverage Function you can achieve your requirement. Link of that function is given below. 

 

Thanks


Hi @abhilashsawla , Moving average takes the average of prior values, isn’t it? I want the metric to look for the future values unless there is a way within moving average function to achieve it?

 

Thanks

Musab


Hi Musab,

The moving average function includes an offset that could either look into past or future values.

 

MOVINGAVERAGE(Input, Window Size , End Offset , Dimension)

  • End Offset - is the offset of the last item within the window relative to current one. This argument defaults to zero, meaning the window includes all items from Window Size - 1 to current one. Default: 0.

For example, if you wish to see the moving formula for 12 items into the future on a 3 items span, your formula should have this parameter included movingaverage(metric, 3, 12)

I made a quick example that can help you visualize the outputs:

 

Hope it helps!

Best,

Benoit

 


Thanks @Benoit  and @abhilashsawla  , it makes a lot of sense now. 


Reply