Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
sum({<YearMonth={$(=$(vEndMonth)-2)}>} Sales)
Please assist, how would I add the addmonth function to the script above and replace the above -2?
The variable vEndMonth is set to:
=MAX(YearMonth)
Many thanks
You can use this, May be?
=Sum({<DATE={"$(=AddMonths(vEndMonth,-2))"}>} SALES)
I would still use YearMonth field in the set analysis here and add Date() function to fix the format....
=Sum({<YearMonth = {"$(=Date(AddMonths(vEndMonth, -2), 'YYYY-MMM'))"}>} SALES)
Replace YYYY-MMM with the format for YearMonth field
First set vEndMonth= Max( Month( Date));
sum({<Date={'$(=addmonths(vEndMonth,-2))'}>}Sales)