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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum last three month sales and only maximum number in last 3 months

Hello all,

I need help with the following: Sum last three month sales and only maximum number in last 3 months.

based on the maximum version, i need to sum the sales amount.

Ex- If i selected 4th month, I will sum the values month 4 - sales 35 ,month 3- sales 20 and month 2 - sales 40. so finally i will get 95.

Thanks in advance.

monthversionsales
1110
1220
1330
2110
2250
2330
2440
3110
3220
4110
4210
4320
4415
4535
4635
11 Replies
sunny_talwar

My bad, try this

=Sum({<month = {"$(='>=' & (Max(month) - 2) & '<=' & Max(month))"}>}Aggr(FirstSortedValue({<month = {"$(='>=' & (Max(month) - 2) & '<=' & Max(month))"}>} sales, -version), month))

Anonymous
Not applicable
Author

It's working nice. Thanks a lot.