Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
An easy approach would be to use multiple actions to first select only the values you want to exclude and then inverting the selection:
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.
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.
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.
Hi
Try
If(Not Match(LANDISOCODE, 'DEU', 'DEP', 'DE-', 'DE_'), Null(), LANDISOCODE)
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)
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)
That looks like the cleanest solution, i try it.
An easy approach would be to use multiple actions to first select only the values you want to exclude and then inverting the selection:
Thanks.
It should be renamed to "Invert selection".
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.