Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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?

Labels (1)
2 Replies
sunny_talwar
MVP
MVP

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