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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

average of the last 12 month

Hi!

I'm freshnew at QV community,

I d like to know how can calcultate the average of the last 12 month (including the active selction (month)) for 3 year

Thanks a lot for your help!

source table

                                                                         
Year Month Births
2012 1 265
2012 2 228
2012 3 271
2012 4 264
2012 5 230
2012 6 281
2012 7 270
2012 8 259
2012 9 293
2012 10 263
2012 11 278
2012 12 238
2013 1 266
2013 2 227
2013 3 246
2013 4 254
2013 5 244
2013 6 290
2013 7 269
2013 8 279
2013 9 278
2013 10 260
2013 11 241
2013 12 253
2014 1 289
2014 2 236
2014 3 282
2014 4 264
2014 5 249
2014 6 276
2014 7 303
2014 8 280
2014 9 262
2014 10 246
2014 11 271
2014 12

Hoped result

Active month Average of the last 12 months (including the active month
2012 263 263
2013 260 261
2014 246 265
3 Replies
ecolomer
Master II
Master II

Here you have an example

Not applicable
Author

Thanks Enrique for your help, however i can't open your document due to my licence policies.

It ll be very kind of you if you can explain me how can i figure out this exemple.

Best regards

ecolomer
Master II
Master II

Yes,

The formula for me in my example are:

='Last 12 months (AVG)= '& AVG({<YearMonth ={">=$(=Date(addmonths(Max(YearMonth), -12), 'MMM-YY')) <=$(=Date(addmonths(Max(YearMonth), -1),  'MMM-YY'))"} >} Sales)