Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling twelve month

Hi,

I need to use a calculation in a chart with YearMonth as dimension and a datefield StockDate (YYYYMMDD). I trying to use following expression but it relly doesn't work.

count({<StockDate ={">=$(=Date(addmonths(monthend(Max(StockDate), -12), 'YYYYMMDD'))) <=$(=Date(addmonths(Max(StockDate), -1),  'YYYYMMDD'))"}, GroupID= {'North'} >} CustomerRoID)

Any one that have any suggestions?

2 Replies
whiteline
Master II
Master II

Try to correct the brackets:

=count({<StockDate ={">=$(=Date(addmonths(monthend(Max(StockDate)), -12), 'YYYYMMDD'))) <=$(=Date(addmonths(Max(StockDate), -1),  'YYYYMMDD'))"}, GroupID= {'North'} >} CustomerRoID)

MayilVahanan

HI

     Try like this

     count({<StockDate ={">=$(=Date(monthend(addmonths(Max(StockDate), -12)), 'YYYYMMDD'))<=$(=Date(Monthstart(addmonths(Max(StockDate), -1)),  'YYYYMMDD'))"}, GroupID= {'North'} >} CustomerRoID)

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.