Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis year filters over two tabls

Hi,

I have two tables that are a copy of each other which allows me to select a set of data for two different periods and built some object with them that I could not do with one table.

Users have asked me to make the filters for the "To" period and "From" period as such that only what should be available to them should be displayed eg. if a user selects 2009 in the From period then the only available years in the To period should be 2009 or later.

I can make that work with set analysis using this:

=aggr(only({<TO_YEAR={">=$(=FROM_YEAR)"}>} TO_YEAR), TO_YEAR)

The problem is this will not display anything if nothing is selected in the From period. So I want to do something like the below expression but as you cannot compare an expression against 0 it doesn't work:

=aggr(only({<TO_YEAR={">=$(=FROM_YEAR)"}>+<0 = {"$(=getselectedcount('FROM_YEAR'))"}>} TO_YEAR), TO_YEAR)

I also cannot do this with an IF statement as my first thought was, because if I say select 2009 in the From period (as defined by IF(From <= To, From)), it will select all values in the To period <= the From period. I don't want anything selected in the To Period.

Any help with this would be greatly appreciated. I have attached an example with both set analysis examples and with the IF statement example. Thank you.

3 Replies
Miguel_Angel_Baeyens

Hi,

Take a look at this example file.

Hope that helps.

Not applicable
Author

That one isn't really restrictive enough. But I might be able to come up with a solution easier if I have a combined year and month field.

Not applicable
Author

Still can't figure out how to do and OR for when a field is not selected 😞