Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
johannes_myers
Contributor
Contributor

Set Analysis: ignore field selection in sum, then define select using variable

I'm trying to display only the most recent 13 months of data in a bar chart, based on the maximum selected date (max date if nothing selected). So far I've tried this is what I've come up with:

=Sum({$<[Function]={"Billable"},[Year]=, Period={"<=$(MAX_PERIOD_ID)"}>} Actual)

The problem is that only one month shows up in the chart when the user selects one month. I know the '$' means the set analysis will respect user selections, and that's fine for all of the fields EXCEPT for Year and Period. Is there a way to tell Qlik to only ignore the user selections in specific fields?

Thanks in advance,

Johannes

3 Replies
jayanttibhe
Creator III
Creator III

You already ignored 'Year' in your expression. Do the same for period  Or whatever fields you wanted to ignore.

This is what you are looking for ? 

=Sum({$<[Function]={"Billable"},[Year]=, Period={"<=$(MAX_PERIOD_ID)"},Period=>} Actual)

VishalWaghole
Specialist II
Specialist II

Try this,

=Sum({$<[Function]={"Billable"},[Year]=, Period={'>=$(=MonthStart(AddMonths(Max(Period),-13))) <=$(=MonthStart(Max(Period)))'}>} Actual)

Thanks,
Vishal
johannes_myers
Contributor
Contributor
Author

Unfortunately that did not work. If the user filters to only one value in the "Period" field, the chart still only shows one bar when using the syntax you suggested.