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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calendar issue: Last 12 months

Hello Everyone,

I want to display the data for last 12 or say last 24 months from current date(say today). How do i do this in qlik sense using set analysis or something?

1 Solution

Accepted Solutions
Not applicable
Author

Use set analysis like this:

count({<[Date_field]={">=$(=addmonths(monthend(max([Date_field])),-12)) <=$(=max([Date_field]))"}>} Value)


Change Date_field fand Value for your date/value field.

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Where do you want to display this data in? A Filter pane or a chart? Can you post a small Qlik Sense app that demonstrates the problem?


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I want to display a chart of last 12 months

Not applicable
Author

Use set analysis like this:

count({<[Date_field]={">=$(=addmonths(monthend(max([Date_field])),-12)) <=$(=max([Date_field]))"}>} Value)


Change Date_field fand Value for your date/value field.

Anonymous
Not applicable
Author

Thank you!! I was using pretty much the same code but was doing a silly mistake. It Works now.

Cheers!!

Not applicable
Author

You're welcome! Please, mark the answer as correct so other people can use this too