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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Toggle Select all except (button)

Hi everyone,

I'm wondering if this is possible... I have a button that I would like to toggle select all field selections except one. The field is called 'type' and the possible values are 1, 2, 3, 4, and 5. When I click the button I would like to select records that have 2, 3, 4, or 5 as their value in the 'type' field. I know that I could just add those values to the search string, but it is possible that I will have more values in 'type' than I do now in the future. So I would like to figure out a way to toggle select all except '1' instead of putting in all the other possible values into the search string. Is this possible?

Thanks!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assign two actions to your button. In the first Action, Select "1". Make the second action "Select Excluded".

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

6 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

You can make use of "Select Excluded" Action in properties

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assign two actions to your button. In the first Action, Select "1". Make the second action "Select Excluded".

-Rob

http://masterssummit.com

http://robwunderlich.com

jpenuliar
Partner - Specialist III
Partner - Specialist III

You can set your button to have the following actions:

1: Select in Field ; Field = type ; Search String = 1

2.  Select Excluded  ; Field = type

Not applicable
Author

Thanks this works. But is there a way to reverse this operation using the same button on the next click? Like replicating the toggle select?

jpenuliar
Partner - Specialist III
Partner - Specialist III

with the same button, no due to the logic the Actions were set.

You could however clone the button, with a Conditional Show (Property: Layout>>Show>>Conditional) using a variable.

This clone button will have either action/s:

A: To explicitly select '1'

     1. Clear Field; Field = type

      2. Select in Field ; Field = type ; Search String = 1 :

B: Since 1 is already excluded by previous button

     1.  Select Excluded  ; Field = type

Not applicable
Author

A possible solution using one button would be by using a trigger and a variable (as well as the original logic provided in the accepted answer to your question). At this point, you're probably well past needing this information, but I thought I'd provide it in case someone else has a similar problem.

First create a variable, i.e. vClearType, and assign it a value of 1. Go to the properties of your button > Action tab >  Add > External > Set Variable. Assign the variable you created and set the value to: =If(vClearType=1,0,1). Click OK and go to Settings > Document Properties > Triggers. Select the variable you created in the Variable Event Triggers section and add an OnChange Action > Selection > Clear Field. Add the following to the Field section: =if(vClearType = 1,'Type').