Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
tracycrown
Specialist
Specialist

Moving Average not working

Dear all

Kindly advise why 4 quarters moving average MA(4) is not working after adding year and quarter in the dimension ?.

The correct answer should be as follows: 

tYearQuarterSalesMA(4)
120141         4.8 
220142         4.1 
320143         6.05.4
420144         6.55.6
520151         5.85.9
620152         5.26.1
720153         6.86.3
820154         7.46.4
920161         6.06.5
1020162         5.66.6
1120163         7.56.7
1220164         7.86.8
1320171         6.36.9
1420172         5.97.0
1520173         8.07.2
1620174         8.4 

 

Thank you

Tracy

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Aggr(RangeAvg(Above(Sum(Sales), 0, 4)), t)

View solution in original post

3 Replies
sunny_talwar

Try this

Aggr(RangeAvg(Above(Sum(Sales), 0, 4)), t)
tracycrown
Specialist
Specialist
Author

Dear Sunny

The answer is correct but how to make first two (t1 & t2) and last (t16) records of MA(4) equal blank ?.

Thank you

Tracy

sunny_talwar

Try this

Aggr(If(RowNo() > 2 and RowNo() <> NoOfRows(), RangeAvg(Above(Sum(Sales), 0, 4))), t)