Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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)
You can use Alternate State for this:
http://www.learnqlickview.com/alternate-states-in-qlikview/
Introduction to alternate states - The Qlik Fix! The Qlik Fix!
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)
What if I want to apply more than 1 filter? For example, I want Year = 2016 and Country = US.
=Sum({<Year = {2016}, Country = {USA}>} Amount)
If I have more than one expression, do I need to apply the Set analysis code to each expression?
Basically, set analysis will filter the record set only and specific for the aggregation function it is used in.
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.