Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

How to replace the functionality of a list box with an expression

I have multiple charts that I would like to limit the output on, but I do not want to use a list box because I do not want the same conditions on all the charts.  For example, on one chart I just want the data from 2016, but on another chart, I want to see 2015 and 2016.  How can I write an expression or dimension in such a manner that it allows me to control the filtering on each chart?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If I understood correctly, you can also just use static filter for your charts, e.g. using set analysis:

Dimension:

Year

Expression chart A

=Sum({<Year = {2016}>} Amount)

Expression chart B

=Sum(<Year = {2015, 2016}>}  Amount)


A Primer on Set Analysis

View solution in original post

6 Replies
swuehl
MVP
MVP

If I understood correctly, you can also just use static filter for your charts, e.g. using set analysis:

Dimension:

Year

Expression chart A

=Sum({<Year = {2016}>} Amount)

Expression chart B

=Sum(<Year = {2015, 2016}>}  Amount)


A Primer on Set Analysis

cliff_clayman
Creator II
Creator II
Author

What if I want to apply more than 1 filter?  For example, I want Year = 2016 and Country = US.

swuehl
MVP
MVP

=Sum({<Year = {2016}, Country = {USA}>} Amount)

cliff_clayman
Creator II
Creator II
Author

If I have more than one expression, do I need to apply the Set analysis code to each expression?

swuehl
MVP
MVP

Basically, set analysis will filter the record set only and specific for the aggregation function it is used in.

The Aggregation Scope

So, yes, if you are using multiple expressions (or multiple aggregations in one expression), you might need to apply the set analysis to each of these aggregation functions.

You can also limit the dimensional scope with a calculated dimension like

=If(Year= 2016, Year)

=If(Country ='US', Country)

and enabling 'suppress when value is NULL' on dimension tab.