Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi , I have the following expression to obtain Last Month based on the selected Month:
sum({<Month={$(=Month(AddMonths(Max(OrderDate),-1)))}>}Sales)
But, when the selected Month = January, it does not change the year.
The correct result should be December of the past year
Thanks
Try
sum({<Month={$(=Month(AddMonths(Max(OrderDate),-1)))},YearField={$(=Year(AddMonths(Max(OrderDate),-1)))}<>}Sales)
Try
sum({<Month={$(=Month(AddMonths(Max(OrderDate),-1)))},YearField={$(=Year(AddMonths(Max(OrderDate),-1)))}<>}Sales)
Do you have Master Calendar script in place to deal with dates?
If yes?
Then use
if(InMonth(TempDate, today(),-1), 1, 0) as LastMonthFlag,
In your Master script
And in front end use
sum({<LastMonthFlag={1}>}Sales)
Are the numbers accurate and just the column header wrong?