Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sibrulotte
Creator III
Creator III

Rolling average in load

Hi,

I have a table with 30 days of conversion rates.

I'd like for each date to give the average of the last 5 days prior to that date. Obviously the first 4 records have no valid average to give.

Do I need to do a loop to create my final table?

2 Replies
sunny_talwar

Something like this should work on a sorted table

RangeAvg(Rate, Peek('Rate', -1), Peek('Rate', -2), Peek('Rate', -3), 'Peek('Rate', -4)) as Rolling5DayAverageRate

QlikNoviceNo1
Contributor III
Contributor III

Hi Simon,

Did you happen to refer this post? I think it should be helpful.

N-period rolling data, moving average, easy solution.

Thanks