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

Single button which toggles between two combinations of multiple field selections (and changes colour as it does so)?

Been wrestling with this one for a while now and not coming right. Please can someone help me resolve. In QV11SR1

I wish to have a single button which toggles between two combinations of multiple field selections (and changes colour as it does so)

The change colour part works fine but not the select field

I have tried umpteen combinations of things, as per http://community.qlik.com/thread/11809 and http://community.qlik.com/message/65538 etc

Please see attached example QVW with my code.

I have a field MarketingGender and I want the button to toggle between the selections of (M|B) and (L|G).

I do not want to select ALL fields or select (M|B|L|G) at once. Somehow I need to clear the selected field between toggles but that doesnt work for me either.

I just want to have the following 2 selection states when I toggle the button:

t1.png

or

t2.png

How can I achieve this. Thanks

1 Solution

Accepted Solutions
Not applicable
Author

See attached; I think that works like you want.

If you have questions on this, let me know.

View solution in original post

8 Replies
Not applicable
Author

See attached; I think that works like you want.

If you have questions on this, let me know.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It works for me using a select of:

=If($(vGender) = -1, 'M', 'L')

and then the B/G as the following toggle select. The clear is not necessary.

Note that the variable test is backwards because the variable value doesn't actually change until the actions are complete.

Example attached.

-Rob

http://robwunderlich.com

Not applicable
Author

Awesome 🙂 Thank you Roberto and Rob, both of your solutions work perfectly for what I want to do here.

Not applicable
Author

Nice!

Perhaps it is required that your name starts with Rob to know such things 😜

Not applicable
Author

Using the * -1 is a great trick.  Thanks!

Not applicable
Author

Using the * -1 is a great trick.  Thanks!

Not applicable
Author

What a neat trick to use * -1

Not applicable
Author

Hehe thanks!

Happy Qlikviewing!