Solved

# Rolling Average

• 4 replies
• 411 views

Userlevel 2
+4
• Budding Pigmenteer
• 13 replies

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
+6

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

Thanks

Userlevel 2
+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
+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)`

Hope it helps!

Best,

Benoit

Userlevel 2
+4

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