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: 
Anonymous
Not applicable

Expression to background color specific text values

Hello All-

Fairly new to Qlik Sense, and trying to create a background color expression for cells in a column.

My general layout is this, with the column heading Status. I want to color certain Status text names green, lets say Status A, Status B, and Status C, but leave the other Statuses white.

Status

Status A

Status B

Status C

Status D

Status E

My current expression is something like:

if([Status]='Status A' OR 'Status B' OR 'Status C', green())

The problem that I am running into is that only "Status A" is showing up green.

5 Replies
Thiago_Justen_

Try this out:

if([Status]='Status A' OR [Status]= 'Status B' OR [Status]= 'Status C', green())

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
yujiyamane
Creator II
Creator II

It should be as below. Please find the attachment for the example.

if([Status]='Status A' OR [Status]= 'Status B' OR [Status]= 'Status C', green())

Anonymous
Not applicable
Author

Awesome, this worked great. Now what if I want to make them different colors, say making Status A and Status B green but make Status C red?

Thiago_Justen_

You could do it:

Pick(WildMatch(Status, 'Status A', 'Status B', 'Status C'),green(),green(),red())


Or


if([Status]='Status A' OR [Status]= 'Status B',green(),red())

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
yujiyamane
Creator II
Creator II

It should be like below. (You just need two if statements)

if([Status]='Status A' OR [Status]= 'Status B', green(),

     if([Status]= 'Status C', red())

)