Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning everyone,
I have an if statement in the expression editor that will display the current month, previos month,next month, when you look at the report. Based on the [MeteringEndDate]
it is a pivot report.
This use to work but not anymore, now I am not sure why? Would love some advice. Maybe even an easier solution.
Expression:
What it should look like
Thanks so much
Kind regards
Theresa
In the script:
Data:
NoConcatenate Load
MonthName(MeteringEndDate) as MeteringEndMonth,
Year(MeteringEndDate) as MeteringEndYear,
MeteringEndDate;
Load
AddMonths(AddYears(YearStart(Today()), -1), RecNo()-1) as MeteringEndDate
AutoGenerate 24;
In the expression:
={<MeteringEndDate={">=$(=AddMonths(MonthStart(Today()), -1)) <=$(=AddMonths(MonthStart(Today()), 1))"}>} Aggr(Only(MeteringEndMonth), MeteringEndMonth)
Here is my data:
Data:
NoConcatenate Load
MonthName(Date) as Month,
Year(Date) as Year,
Date;
Load
AddMonths(AddYears(YearStart(Today()), -1), RecNo()-1) as Date
AutoGenerate 24;
And here the expression and the result:
={<Date={">=$(=AddMonths(MonthStart(Today()), -1)) <=$(=AddMonths(MonthStart(Today()), 1))"}>} Aggr(Only(Month), Month)
Make sure to disable "Include null values".
Hi,
Maybe this is a stupid question but do I now replace my date field "MeteringEndDate" with your "Date" field?
Thanks
Theresa
In the script:
Data:
NoConcatenate Load
MonthName(MeteringEndDate) as MeteringEndMonth,
Year(MeteringEndDate) as MeteringEndYear,
MeteringEndDate;
Load
AddMonths(AddYears(YearStart(Today()), -1), RecNo()-1) as MeteringEndDate
AutoGenerate 24;
In the expression:
={<MeteringEndDate={">=$(=AddMonths(MonthStart(Today()), -1)) <=$(=AddMonths(MonthStart(Today()), 1))"}>} Aggr(Only(MeteringEndMonth), MeteringEndMonth)
Thank you so much.
This is great.