Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all.
I have a code that is supposed to show rolling 12 months based on selected period.
example. Choose 201206 and the line graph should display from 201206 and 12 months back.
The formula:
sum({$<KVGruppe2={'%Rent'}>}{<Period ={">=$(=addmonths(Max(Period), -12)) <=$(=addmonths(Max(Period), 0, 'YYYYMM'))"} >}OutOfOuterLimit)
But when I try this it goes all the way back to 200901.
I tried to set dimmension to =if(period <StartPeriod, period)
StartPeriod is allways period -12.
Anyone see why?
BR
Dan
Edited: Added an example
it'll be better if you will send small sample app
Hi
I have created a test that shows what I am trying.
BR
Dan
Try the Sample App..
Hope iit helps!!
Hi Rajni
I tried to alter my test app to suit your sample. Created two variables, but I still do not get it to do as needed.
I get it to start at my selected period, but it does not end at -12 months. It goes all the way back.
Your code and my code(the original one) seems to do the same.
Dan
the problem is ur max(period) is giving out the result 201009, which is assumed as number of date so when i change it into date it gives 04-05-2450 as Output,
date(max(Period),'DD-MM-YYYY') returns 04-05-2450
AddMonths(max(Period),-1) returns 04-04-2450
you should take some other field for selection
Hope it helps!!
or you can use makedate(split the period field in year, month,day)
Hi,
Please find the attached file.
Regards,
Som
Hi dan,
Your Code and Rajni code is same but
rajni code that dimension is date format and your code is string format first change that code string to date then u can try, it works