Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Partner
Partner

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?

Tags (1)
4 Replies
Highlighted

Re: Toggle button for field selections, color changes

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

Highlighted
Partner
Partner

Re: Toggle button for field selections, color changes

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.

Highlighted
nickedw0
Contributor

Re: Toggle button for field selections, color changes

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]

Highlighted
nickedw0
Contributor

Re: Toggle button for field selections, color changes

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

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