Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

moving average in qlikview

i´m looking for an example of moving average in qlikview

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Here's an example of two ways to handle a rolling 50-day average. The difference is in what you do for the first 50 days. For the blue line, it just takes the average of the days so far. For the red line, it assumes that the value was 0 for the previous 50 days, so takes a straight 50 day average assuming 0 for those days. The to lines converge after 50 days, of course.

In a real application, I have a rolling year average by week, and instead of taking the previous 52 weeks, I actually take the previous 26 weeks and next 26 weeks. So the period being averaged is centered on the displayed date, rather than the displayed date being the end of the period. For the start and end of the date range, I average the weeks that are available, so I'm using as few as 26 weeks in the average.

View solution in original post

3 Replies
johnw
Champion III
Champion III

Here's an example of two ways to handle a rolling 50-day average. The difference is in what you do for the first 50 days. For the blue line, it just takes the average of the days so far. For the red line, it assumes that the value was 0 for the previous 50 days, so takes a straight 50 day average assuming 0 for those days. The to lines converge after 50 days, of course.

In a real application, I have a rolling year average by week, and instead of taking the previous 52 weeks, I actually take the previous 26 weeks and next 26 weeks. So the period being averaged is centered on the displayed date, rather than the displayed date being the end of the period. For the start and end of the date range, I average the weeks that are available, so I'm using as few as 26 weeks in the average.

Not applicable
Author

Hi John,

Thank's very much for the quick reply. It´s precisely what I needed to know.

Not applicable
Author

Hi John,

In the example you are showing, there is only the backwards looking average, correct? Could you also post an example of the centered moving average like you explained?

Or am I missing something in the document you posted?