Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello friends,
I'm reaching out for some help, I'm trying to get trailing 12 months based on the data below.
My most current period is 202009. Trailing 12 months should give me 201910 thru 202009.
Any help in writing the set analysis is greatly appreciated.
FiscalPeriod | SALES |
201901 | 13,214 |
201902 | 14,353 |
201903 | 21,208 |
201904 | 13,478 |
201905 | 14,642 |
201906 | 22,104 |
201907 | 14,903 |
201908 | 15,546 |
201909 | 20,605 |
201910 | 15,974 |
201911 | 16,297 |
201912 | 22,911 |
202001 | 13,794 |
202002 | 14,364 |
202003 | 20,860 |
202004 | 14,926 |
202005 | 13,744 |
202006 | 19,176 |
202007 | 15,169 |
202008 | 15,491 |
202009 | 17,819 |
What if you try this expression:
sum(aggr(rangesum(above( sum({<FiscalPeriod=>} SALES),0,12)),FiscalPeriod))
hi Vegar,
i tried that, though it's showing more than 12 months. if possible i would like to select a fiscal period and have the data only show 12 months back from what was selected
@alexcastorena Assuming your fiscal period is formatted as proper date using Date(Field,'YYYYMM') if not then first convert it and then you can try below
sum({<FiscalPeriod={">=$(=date(addmonths(max(FiscalPeriod),-11),'YYYYMM'))<=$(=date(max(FiscalPeriod),'YYYYMM'))"}>}
aggr(rangesum(above( sum({<FiscalPeriod=>} SALES),0,12)),(FiscalPeriod,(NUMERIC,ASCENDING))))
Hello Kush,
Unfortunately, the fiscal period that i was given is already in YYYYMM, no other date is available.
i tried this set analysis formula, but it only gives me data for 2020
sum({<FiscalPeriod={'>=$(=max(FiscalPeriod)-12)<=$(=max(FiscalPeriod))'}>}Sales)
@alexcastorena did you try the full expression provided? Seems you are using just part of the expression.
i did try the formula you provided though it did not work