Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
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
MVP & Luminary
MVP & Luminary

Re: one button to select and deselect values in a field

See attached example


talk is cheap, supply exceeds demand

View solution in original post

13 Replies
MVP & Luminary
MVP & Luminary

Re: one button to select and deselect values in a field

See attached example


talk is cheap, supply exceeds demand

View solution in original post

Not applicable

Re: one button to select and deselect values in a field

thanks for your effort!

but the variable is not there..

Re: one button to select and deselect values in a field

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)', '')

MVP
MVP

Re: one button to select and deselect values in a field

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

then you select or clear depending on the variable

MVP
MVP

Re: one button to select and deselect values in a field

Like this?

MVP & Luminary
MVP & Luminary

Re: one button to select and deselect values in a field

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


talk is cheap, supply exceeds demand
Not applicable

Re: one button to select and deselect values in a field

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

Re: one button to select and deselect values in a field

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?

MVP & Luminary
MVP & Luminary

Re: one button to select and deselect values in a field

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