Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Centered Moving Average in Qlikview?

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:

WeekSalesMoving Average
110-
212-
3910,3
41512,0
52516,3

What I want it to do is this:

WeekSalesMoving Average
110-
21210,3
3912,0
41516,3
525-

Can anyone tell me how to do this?

Best regards,

Claus

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

How about:


rangeavg(above(Sales,0,2),below(Sales, 1, 1))



View solution in original post

2 Replies
Highlighted
Partner
Partner

How about:


rangeavg(above(Sales,0,2),below(Sales, 1, 1))



View solution in original post

Highlighted
Not applicable

Thank you so much Simen - that works perfectly

You're my hero!