Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
skovsgaard
Contributor II
Contributor II

Sum last 12 months on load for each month loaded

Hi

I am pretty new to Qlikview, but have so far found a lot of usefull help by reading old posts - but I have now come to an issue I can't find a solution to, and hope you can help.

I have a set of data that I already using groubp by have aggregated to look something like below.

YearMonthValue
201141
201152
201163
201174
201185
201196
2011107
2011118
2011129
2012110
2012211
2012312
2012413
2012514
2012615

I would like to have each month aggregated even further, so that the value of the month is the sum of the last 12 months, i.e. month 3 year 2012 should have a value of 78 (1+2+3+4+5+6+7+8+9+10+11+12). Likewise month 4 year 2012 should have a value of 90 (2+3+4+5+6+7+8+9+10+11+12+13) etc.

I want this to happen in the load script, so I can store the result as a QVD file to be loaded in other QV apllications. Naturally I have additional dimensions, and this aggregation should work for the other dimensions as well, meaing a last 12 month sum for product A and a last 12 month sum for product B.

I hope the example makes sense and you can provide me with the hints of a solutions, so I in the end can expand it over several countries and also calculated for last 52 weeks.

Regards

Soren

1 Reply
skovsgaard
Contributor II
Contributor II
Author

Hi

I think I found the solution, by further developing the script from the below post.

http://community.qlik.com/message/162306#162306

Regards

Soren