Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
desc
Contributor
Contributor

Set Analysis and Dates

Hi there,

 

I’m new Qlik and I have an issue that I’m having difficulty trying to resolve. I want to create a dashboard that contains a line chart that restricts activity to the last 12 months (the dataset has over 60mths of data). I have got this working via set expression.

As below:

sum({$<[Period]={">=$(=AddMonths(Max([Period]),-12)) <=$(=MonthEnd(Max([Period])))"}>}[Period Actual])

 

The problem I have is that the same field [Period] also needs to be a filter on the dashboard – to enable a user to hone in on a given visualisation. Currently when this filter is used the 12 month trend graph is not persisted and displays a single point. Which is not the behaviour I’m after. I have tried using 1 instead of the $ and that doesn’t give me the result I’m looking for as – the other filters on the dashboard need to affect the  line chart.

Any help welcome! 

Thanks!

 

Labels (4)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Then you need to rephrase or explain your issue in more details. Maybe you can share a screenshot of your output and try to explain what your desired output is. 

View solution in original post

4 Replies
Vegar
MVP
MVP

Could it be that you are making selections i other master calendar fields than just [Period], e.g. [Year] or [Month]?

If so then you need to cancel these selections in your expression. 

sum({$< [Year]=, [Month]=, [Period]={">=$(=AddMonths(Max([Period]),-12)) <=$(=MonthEnd(Max([Period])))"}>}[Period Actual])

desc
Contributor
Contributor
Author

thanks for replying. I only have Period as a calendar item.

 

Vegar
MVP
MVP

Then you need to rephrase or explain your issue in more details. Maybe you can share a screenshot of your output and try to explain what your desired output is. 

desc
Contributor
Contributor
Author

Sure – hopefully the below will clarify

I need the bar chart displayed always to show the last 12 months. I need the filters excluding the Month to reflect what the user has selected. This works ok using the set analysis previously described.

Picture1 qlik.png

The problem occurs when the month filter is used, when this is used – the bar chart is also affected.

Picture2 qlik.png

The bar chart and month filter are based on the same Period dimension.