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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
eikenberg
Contributor III
Contributor III

Select all values from a filter pane not in a list via button

Hello,

i have a filter pane with "LANDISOCODE" and want to select all entries except some in a list when i press a button.

List list is ~180 entries long and i want to exclude 4 entries.

I tried a button with action "Select values matching search criteria" and different versions of a function like

If(Match(LANDISOCODE, 'DEU', 'DEP', 'DE-', 'DE_'), Null(), LANDISOCODE)

='=(If(Match(LANDISOCODE, "DEU", "DEP", "DE-", "DE_"), Null(), LANDISOCODE))'

but none is working.

How can i do this?

 

Labels (1)
1 Solution

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

An easy approach would be to use multiple actions to first select only the values you want to exclude and then inverting the selection:

LRuCelver_0-1709043909551.png

LRuCelver_1-1709043926264.pngLRuCelver_2-1709043963087.pngLRuCelver_3-1709043986455.png

View solution in original post

8 Replies
singulariteetti
Contributor
Contributor

Hello,

In Qlik Sense, achieving a selection of all values from a filter pane excluding a specific list of values through a button action can be a bit tricky because of the way Qlik interprets set analysis and search criteria in actions. Unfortunately, directly using an If statement within a button action to exclude values might not work as expected due to the nature of how search strings are interpreted.

  1. Create a Variable: First, you need to create a variable that holds the expression for the selection criteria excluding the specific codes. This variable will essentially generate a search string that includes all codes except the ones you want to exclude.

  2. Use the Variable in Button Action: Then, you can use this variable within your button action to select values matching the generated search criteria.

Sponsored by ChatGPT - This explanation sounds reasonable to me.

Brian_C
Contributor III
Contributor III

Hi

Try 

If(Not Match(LANDISOCODE, 'DEU', 'DEP', 'DE-', 'DE_'), Null(), LANDISOCODE)
Brian_C
Contributor III
Contributor III

In fact swap the Null and LANDISOCODE around if using not match in this way.

If(Not Match(LANDISOCODE, 'DEU', 'DEP', 'DE-', 'DE_'), Null(), LANDISOCODE)
Brian_C
Contributor III
Contributor III

Another solution would be in the script to create a flag by adding the line below:

If(not Match(LANDISOCODE, 'DEU', 'DEP', 'DE-', 'DE_'),'Y','N')as Include_Flag

then in the filter use Only(<{ Include_Flag={'Y'}>}LANDISOCODE)

 

 

eikenberg
Contributor III
Contributor III
Author

That looks like the cleanest solution, i try it.

LRuCelver
Partner - Creator III
Partner - Creator III

An easy approach would be to use multiple actions to first select only the values you want to exclude and then inverting the selection:

LRuCelver_0-1709043909551.png

LRuCelver_1-1709043926264.pngLRuCelver_2-1709043963087.pngLRuCelver_3-1709043986455.png

eikenberg
Contributor III
Contributor III
Author

Thanks.

It should be renamed to "Invert selection".

LRuCelver
Partner - Creator III
Partner - Creator III

There are two options for selecting other values: alternative and excluded values.

Alternative values are all values that could be selected with the current selections, but are not. They have a light gray background.

Excluded values are all values that you cant select because some other selection is blocking them. They have a dark gray background.