Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i´m looking for an example of moving average in qlikview
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.
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.
Hi John,
Thank's very much for the quick reply. It´s precisely what I needed to know.
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?