Qlik Community

Qlik Sense App Development

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

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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)

Highlighted
Specialist II
Specialist II

Try this,

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

Thanks,
Vishal
Highlighted
Contributor
Contributor

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.