Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ashriniv
New Contributor

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

Re: Calendar issue: Last 12 months

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.

5 Replies

Re: Calendar issue: Last 12 months

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
ashriniv
New Contributor

Re: Calendar issue: Last 12 months

I want to display a chart of last 12 months

Not applicable

Re: Calendar issue: Last 12 months

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.

Highlighted
ashriniv
New Contributor

Re: Calendar issue: Last 12 months

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

Cheers!!

Not applicable

Re: Calendar issue: Last 12 months

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

Community Browser