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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Text object change color when value get associated

hello everyone

In below, i used Action>select in field on text object. my query is when i select abc from  emp_name list box that time text object will show as a active as below.

Thank You.

17 Replies
rubenmarin1

Hi Prachi, for only that value selected can be set the conditional color to:

If(emp_name='abc', RGB(Color1), RGB(Color2)) // Change ColorX to the color codes

For that value in selected values can be:

If(Index(';' & GetFieldSelections(emp_name, ';') & ';', 'abc'), RGB(Color1), RGB(Color2)) // Change ColorX to the color codes

devarasu07
Master II
Master II

Hi,

try like below,

just create calculated text box color using below expression

if(GetFieldSelections(emp_name)='abc',green(),White())

Capture.JPG

note: if you selecting multi value then u have use concatenate function within the expression

Anonymous
Not applicable
Author

i don't want to show for a single value, i want to show  like if i select any value associated with IT or BPO then it will change color

neha_shirsath
Specialist
Specialist

Please find the attached file.

Anonymous
Not applicable
Author

I have PE ,please share screen shot

devarasu07
Master II
Master II

then u can use getselectedcount function.

if(GetSelectedCount(emp_name)>0,green(),White())

rubenmarin1

Very similar to use with Dept field, only change is that values are not selected directly, so GetFieldSelctions can't be used:

If(Index(';' & Concat(Distinct Dept, ';') & ';', ';IT;'), RGB(Color1), RGB(Color2)) // Change ColorX to the color codes


The semicolons is to avoid miscounts with possible departments containing string 'IT' in the full name

mdmukramali
Specialist III
Specialist III

Hi,

can you try the below color expression :

for BPO :

=if(Concat(Distinct Dept,',')<>Concat(DISTINCT{1} Dept,',') and Index(Concat(Distinct Dept,','),'BPO')=1,Green(),RGB(213,238,248))


for IT:

=if(Concat(Distinct Dept,',')<>Concat(DISTINCT{1} Dept,',') and Index(Concat(Distinct Dept,','),'IT')=1,Green(),RGB(213,238,248))

sasikanth
Master
Master

Hi Prachi,

you can use below expression

For IT text Object:

=IF( SubStringCount(Concat( Dept,'|'),'IT')>0 ,Green())


For BPO text object :

=IF( SubStringCount(Concat( Dept,'|'),'BPO') >0 ,Green())