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: 
Not applicable

Average at Script Level

Hello,

How to calculate 5 week rolling average at the script level using RangeAvg function.

Attaching excel file for your reference.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

LOAD [Fiscal Week Ending],

     Amount,

     [5 Week Rolling Avg],

     rangeavg(

               Amount,

               peek(Amount,-1),

               Peek(Amount,-2),

               peek(Amount,-3),

               peek(Amount,-4)

                                                       ) as myRollingAvg

FROM

(biff, embedded labels, table is Sheet1$);

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
Champion III
Champion III

LOAD [Fiscal Week Ending],

     Amount,

     [5 Week Rolling Avg],

     rangeavg(

               Amount,

               peek(Amount,-1),

               Peek(Amount,-2),

               peek(Amount,-3),

               peek(Amount,-4)

                                                       ) as myRollingAvg

FROM

(biff, embedded labels, table is Sheet1$);

Hope this helps,

Stefan

Not applicable
Author

Dear Stefan,

This is great. Helped me a lot.

Thanks a lot for your reply.

Nassar