Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

Set Analysis for looking at data 12 months back from Max(Date) field?

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

3 Replies
sunny_talwar

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

jblomqvist
Specialist
Specialist
Author

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?

sunny_talwar

Then try this:

Sum({<Date = {">= $(=Num(AddYear(Max(Date),-1)))"}>}Sales)