Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Rolling Average for 3 months

I have month with year, sales. I want rolling 3 months sum. If I click only Dec 2012, it should show the previous 3 months rolling sum. I tried this expression, it doesn't work according to my requirement "sum( aggr( rangesum( above( sum(Sales),0,12) ),Month))". Can anybody help?

error.png

6 Replies
kkkumar82
Specialist III
Specialist III

Do you have any Month Number column in your data model then it would be easy,

In Your expression expression your are using 12 months rolling but you want it for selections right?

kkkumar82
Specialist III
Specialist III

Is your requirement only for selections or without selections also, if possible give other month columns

rammuthiah
Creator III
Creator III
Author

Without selection

OmarBenSalem

In your script,

Create :

,AutoNumber(Num(Month(YourDateField, '00')&'/'&Year(YourDateField, '%Year month SEQ') as [%Year month SEQ]

Than, as an expression :

sum({<YourDateField=,Month=, Year=,[%Year month SEQ]= {">$(=max([%Year month SEQ]) - 4)  <=$(=[%Year month SEQ])"}>}sales)

result if I select Fev 2017 :

Capture.PNG

rammuthiah
Creator III
Creator III
Author

Can anybody tell the solution for Rolling Month?

sunny_talwar

Best way to do this would be to use The As-Of Table