Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an expression that displays a KPI for the last 12 months like this:
SUM({$<ACC_DATE={">=$(=MONTHSTART(MAX(ACC_DATE),-11))<=$(=MAX(ACC_DATE)-1)"}>}AMOUNT)
So that means I get the AMOUNT between April 2016 and March 2017.
I need to see the data until the last month is closed, that's why I don't consider the current month, April 2017.
The thing is that if I select Year = 2016, it shows me from January 2016 to November 2016 (without December 2016).
What I would need is to show the following:
- At the beginning: Last 12 months (without current month).
- If I select a year: The corresponding period (from Jan to Dec).
- If I select a year and a month: The data for that month only.
- If I select a year and N months: The data for those months only.
Do you know how could I handle this?
Thank you!
Please dont create duplicate threads. Rolling Last 12 Months
Maybe this one?
If (GetSelectedCount ([Year]) = 0 , SUM({$<ACC_DATE,[Rolling 12]={1}>}AMOUNT), If (GetSelectedCount ([Year List]) > 0 , SUM({$<ACC_DATE,[Last Year Flag]={1} >+< [Month]>0}AMOUNT)
I'm not sure if this will work?
[Rolling 12] field is defined in Master Calendar to only show last 12 month from current date.
Below is the code to be used in Master Calendar...
[Rolling 12]:
If( TempDate > monthstart(addmonths(today(),-11)) and TempDate <= Today(),1) | as [Rolling 12], |
Last Year Flag: if(InYear(TempDate, today(),-1), 1, 0) as LastYearFlag,
I guess if you provide a sample data it would be more easy or perhaps someone with expertise level can help you here?
Hi
I think you are looking for this:
- At the beginning: Last 12 months (without current month).
- If I select a year: The corresponding period (from Jan to Dec).
- If I select a year and a month: The data for that month only.
- If I select a year and N months: The data for those months only.
The app is attached below respective to the above screen shots.
Hope you will find your expected answer.