Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to know how to create a centered moving average in qlikview.
So far, I have only been able to create a moving average looking a certain number of weeks into the past or future. This was using the
rangeavg(above(Sales,0,3))
Which looks 3 weeks into the past.
If i put a negative number in the offset, it will become a below( formula instead.
So what it is doing now is this:
Week | Sales | Moving Average |
---|---|---|
1 | 10 | - |
2 | 12 | - |
3 | 9 | 10,3 |
4 | 15 | 12,0 |
5 | 25 | 16,3 |
What I want it to do is this:
Week | Sales | Moving Average |
---|---|---|
1 | 10 | - |
2 | 12 | 10,3 |
3 | 9 | 12,0 |
4 | 15 | 16,3 |
5 | 25 | - |
Can anyone tell me how to do this?
Best regards,
Claus
How about:
rangeavg(above(Sales,0,2),below(Sales, 1, 1))
Thank you so much Simen - that works perfectly
You're my hero!