Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
month | version | sales |
1 | 1 | 10 |
1 | 2 | 20 |
1 | 3 | 30 |
2 | 1 | 10 |
2 | 2 | 50 |
2 | 3 | 30 |
2 | 4 | 40 |
3 | 1 | 10 |
3 | 2 | 20 |
4 | 1 | 10 |
4 | 2 | 10 |
4 | 3 | 20 |
4 | 4 | 15 |
4 | 5 | 35 |
4 | 6 | 35 |
My bad, try this
=Sum({<month = {"$(='>=' & (Max(month) - 2) & '<=' & Max(month))"}>}Aggr(FirstSortedValue({<month = {"$(='>=' & (Max(month) - 2) & '<=' & Max(month))"}>} sales, -version), month))
It's working nice. Thanks a lot.