# New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

## moving average in qlikview

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

1 Solution

Accepted Solutions
MVP

## 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.

3 Replies
MVP

## 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.

Not applicable

## moving average in qlikview

Hi John,

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

Not applicable

## Re: moving average in qlikview

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?