Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have below dataset with month_end date and Sales. I have to calculate Rolling 12 month sales for each month end.
I have tried
sum(aggr(rangesum(above( total sum({<month_end=>}sales),0,12)),month_end)) , but for 20140131, for past 12 it is picking up values for 20150831,0731.... in a round robin way.
for 20140131 I just want to see rolling 12 mon sum for sales = 100 . Are there any other ways to accomplish Rolling 12 month sum with these month end dates?
month_end | sales |
20140131 | 100 |
20140228 | 101 |
20140331 | 102 |
20140430 | 103 |
20140531 | 104 |
20140630 | 105 |
20140731 | 106 |
20140831 | 107 |
20140930 | 108 |
20141031 | 109 |
20141130 | 110 |
20141231 | 111 |
20150131 | 112 |
20150228 | 113 |
20150331 | 114 |
20150430 | 115 |
20150531 | 116 |
20150630 | 117 |
20150731 | 118 |
20150831 | 119 |
Hi,
I might have an answer for you. I believe we may need to implement sorted Aggr() function so that when you sort the dimensions, the 12 month rolling sum won't change:
Let me know if this is what you are looking for.
Thanks