Skip to main content
Solved

Rolling Average

  • July 26, 2023
  • 4 replies
  • 784 views

Forum|alt.badge.img+5

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

Best answer by Benoit

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

 

4 replies

abhilashsawla
Master Author
Forum|alt.badge.img+7
  • Master Author
  • 104 replies
  • July 27, 2023

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

 

Thanks


Forum|alt.badge.img+5
  • Author
  • Wallflower
  • 14 replies
  • July 27, 2023

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


Benoit
Community Manager
Forum|alt.badge.img+15
  • Community Manager
  • 232 replies
  • Answer
  • July 28, 2023

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

 


Forum|alt.badge.img+5
  • Author
  • Wallflower
  • 14 replies
  • July 28, 2023

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