Solved

Rolling Average

  • 26 July 2023
  • 4 replies
  • 567 views

Userlevel 3
Badge +4

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

icon

Best answer by Benoit 28 July 2023, 09:55

View original

4 replies

Userlevel 4
Badge +7

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

 

Thanks

Userlevel 3
Badge +4

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

Userlevel 6
Badge +12

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

 

Userlevel 3
Badge +4

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

Reply