Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

one button to select and deselect values in a field

dear all,

I can achieve the following with two separate buttons and it is a fairly easy task

fieldA: select values x,y,z

fieldA: no selections

How can I indeed have just one button doing that? You click it, it selects x,y,x, you re-click on it and all selections for that field are cleared?

thank you!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand

View solution in original post

14 Replies
Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
Not applicable
Author

thanks for your effort!

but the variable is not there..

alexandros17
Partner - Champion III
Partner - Champion III

Write in your action condition (Select in field)

In the upper textbox the name of your field (for example: field)

in the second textbox:

=if(GetSelectedCount(field)=0, '(A|B|C)', '')

maxgro
MVP
MVP

add an action to the button to set the state in a variable

then you select or clear depending on the variable

MK_QSL
MVP
MVP

Like this?

Gysbert_Wassenaar

Oops. Removed too much from the example. I've updated the example above.


talk is cheap, supply exceeds demand
Not applicable
Author

almost perfect Alessandro

should rather be

in the second textbox:

=if(GetSelectedCount(field)=0, '(A|B|C)', '()')

with the double brackets in the last parameter of the if function

but huge thanks for pointing me in the right direction!!

Not applicable
Author

thanks Gysbert, it works now!

but, it looks like magic to me, as I cannot understand how!

clicking on a button switches the variable value from 0 to -1

but where is it mapped that -1 corresponds to Jason and John?

Gysbert_Wassenaar

There's an action assigned to the OnChange trigger of the variable. You can find it on the Triggers tab of the Document Properties window.


talk is cheap, supply exceeds demand