Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello guys,
I have a problem, so I want to do a special filter :
I need to have only the payment dates 1 years old age (by YYYYMM format)
For example :
Max payment date = 202108 so I need all the monthyear between this date and 202108 minus 1 year so 202008 -> 202108 202107 202106 ... 202009 202008
I put this formula in the filter object :
=if(date([PAYMENT DATE],'YYYYMM') >= date(max( addyears([PAYMENT DATE],-1)), 'YYYYMM'), date([PAYMENT DATE],'YYYYMM'), '')
But the formula seems good, when I validate it, the dimension is not good
Can someone help me please,
Thanks a lot
A calculated dimension will need an aggr, i'll assume you want this related to PAYMENT DATE. Also globalize your max calcuation with $(=. Try this...
=aggr(if(date([PAYMENT DATE]) >='$(=date(max( addyears([PAYMENT DATE],-1))))', date([PAYMENT DATE],'YYYYMM'), null()) , [PAYMENT DATE])
Thanks for your solution, it works but don't have the result I expect
I did it without aggr for one of my filter and it works (I would like the same for my dimension payment date)
=if([DOC TYPE]='3Z'or [DOC TYPE]='60', [DOC TYPE], '')
how about
=if(date([PAYMENT DATE]) >='$(=date(max( addyears([PAYMENT DATE],-1))))', date(floor(MonthName([PAYMENT DATE])),'YYYYMM'), null())
Yes, it works !
Thanks a lot stevejoyce!