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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
crystles
Partner - Creator III
Partner - Creator III

Toggle button for field selections, color changes

I have a document that I am creating that will be used on a large touch screen TV.

I need to create a few toggle buttons to select/filter between 4 fiscal quarters. Also I need one that would select all Quarters (the entire year) and a Trailing 12 month button as well.

I have tried using text boxes which work well to toggle the selections, but I need the background color to change when selecting it, so the user can know which selections are made.

I tried setting up some variables (vQ1, vQ2... etc) but the colors seem to get out of sync when making multiple selections/unselecting.

Does anyone know of a proper or more efficient way of completing this?

4 Replies
sunny_talwar

Would you be able to share a sample to look at?

crystles
Partner - Creator III
Partner - Creator III
Author

My current solution that I was able to come up with is this.

Variable:

vbQ1: ='('&if(GetSelectedCount( FQTR )=0,'',GetFieldSelections( FQTR,'|' ) )&')'

(This just gives me the list of which selections are made for the Field, FQTR)

Then in my text boxes, for "Q1" I have this

Actions -> Toggle Select: FQTR = 1Q

And then for the background of the text box I have a calculated color

=if( SubStringCount(vbQ1,'1Q')=1,$(vButtonBGColor2),$(vButtonBGColor1))

This does seem to work, but I feel like I should just be able to use GetFieldSelections() in the background color calculation instead of having to create a variable to capture the selections made, but for some reason it never worked.

nickedw0
Creator
Creator

I have this for button color:

=if( GetFieldSelections([Material Updates])='Yes',$(cButtonDownColor),$(cButtonUpColor))

This works where button is used to only display rows matching a 'Yes' in [Material Updates]

nickedw0
Creator
Creator

Of Course, Action for my button is same as above:

Actions -> Toggle Select: [Material Updates] = 'Yes'