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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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
MVP
MVP

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