Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Box Button Change Values, BG & Font Color

Hi stevedark‌ , here's in relation to my questions about buttons..

https://community.qlik.com/docs/DOC-4289?et=watches.email.document_comment#comment-62133

The questions are listed in one of the text box in the attachment.

...

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Janice,

You want to add this to your load script to set colour variables:

let vColHighlight = 'rgb(180,255,180)';

let vColNoHighlight = 'rgb(255,255,255)';


You then need to set calculated colours on the two buttons, to change the colour on click:


if(vShowChart = 'Prod Tablebox Chart', $(vColHighlight), $(vColNoHighlight))

and

if(vShowChart = 'Store Chart', $(vColHighlight), $(vColNoHighlight))


You can do expressions in the boxes such as this, these will then toggle:


=if(vShowChart = 'Prod Tablebox Chart', Count(DISTINCT {<[Store] = {'*ABC*'}>} [Product]), Count(DISTINCT {<[Store] = {'*ABC*'}>} [Store]))


The store count will always show 1 though?


The colour expression for those boxes should be based on the selection, like this:


=if(vShowChart = 'Prod Tablebox Chart', Count(DISTINCT {<[Store] = {'*ABC*'}>} [Product]), Count(DISTINCT {<[Store] = {'*ABC*'}>} [Store]))


And the action should set the value in a similar way:


=if(GetFieldSelections(Store) = '*ABC*', null(), '*ABC*')


Hopefully that gives you what you want?  A solution is attached.


Steve

View solution in original post

1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Janice,

You want to add this to your load script to set colour variables:

let vColHighlight = 'rgb(180,255,180)';

let vColNoHighlight = 'rgb(255,255,255)';


You then need to set calculated colours on the two buttons, to change the colour on click:


if(vShowChart = 'Prod Tablebox Chart', $(vColHighlight), $(vColNoHighlight))

and

if(vShowChart = 'Store Chart', $(vColHighlight), $(vColNoHighlight))


You can do expressions in the boxes such as this, these will then toggle:


=if(vShowChart = 'Prod Tablebox Chart', Count(DISTINCT {<[Store] = {'*ABC*'}>} [Product]), Count(DISTINCT {<[Store] = {'*ABC*'}>} [Store]))


The store count will always show 1 though?


The colour expression for those boxes should be based on the selection, like this:


=if(vShowChart = 'Prod Tablebox Chart', Count(DISTINCT {<[Store] = {'*ABC*'}>} [Product]), Count(DISTINCT {<[Store] = {'*ABC*'}>} [Store]))


And the action should set the value in a similar way:


=if(GetFieldSelections(Store) = '*ABC*', null(), '*ABC*')


Hopefully that gives you what you want?  A solution is attached.


Steve