Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello there,
Can anyone share an example of how to write Set Analysis expression for looking at data for the last 12 months from Max(Date) field?
The Date field contains the dates and I want to look at the last 12 months data only from the max Date.
E.g. It would be part of Sum(Sales) expression.
Thank you ![]()
May be this:
Sum({<Date = {"$(='>=' & Date(AddYear(Max(Date),-1)))"}>}Sales)
just need to make sure that $(='>=' & Date(AddYear(Max(Date),-1))) has the same format of date as Date field otherwise this won't work.
Best,
Sunny
Hi Sunindia,
Thank you for your reply
Currently my Date is in the numeric format.
I am also using this Date field for a calculated dimension, where I am formatting it to =Date(Date,'MMM-YY') format. Do I need to add this formatting to my Max function also?
Then try this:
Sum({<Date = {">= $(=Num(AddYear(Max(Date),-1)))"}>}Sales)