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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formatting Text on a Button

I would like the text on the buttons atached to turn red when active.

The toggle facility is loaded into each button and the user can add stops by clicking on each button in turn. I can only get one button at a time to show as red text but what I want is for the text on each button to remain red until the selection is cleared

9 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Glenn,

You want the expressions:

=If(maxstring({<Stop*={'MKT'}>}Stop)='MKT',LightRed())

and

=If(maxstring({<Stop*={'PIC'}>}Stop)='PIC',LightRed())

Note the * symbol in the Set Analysis - this takes into account your actual selections in that field and overlays the value in the set.  This should then give you the highlighting you want.

Steve

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try =If(GetSelectedCount(Stop) AND SubStringCount(concat(distinct '^'& Stop & '^'),'^MKT^'),LightRed())

See attached qvw.


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

Like this?

Anonymous
Not applicable
Author

or simply

if(GetFieldSelections(Stop) like '*PIC*',lightred())

for PIC button font color and

if(GetFieldSelections(Stop) like '*MKT*',lightred())  for MKT button font color

SunilChauhan
Champion II
Champion II

see the attched image

hope this helps

Sunil Chauhan
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Wow, that's an elegant solution. Thank you for that.


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

Hi Gysbert,

Nice solution...

is there any specific reason you have added...

'^'& Stop & '^'

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks Gysbert.

I'm a big fan of using colours on text boxes to convey information, so often use solutions like that one.  I've a number of tips an tricks explained in this example document:

QlikView App: At The Qlik Of A Button

Steve

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

To make sure only the right Stop value (the exact match) will be matched by the substringcount function. But Steve's solution is much nicer. It a lot simpler and shorter.


talk is cheap, supply exceeds demand