Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

tristan_walters
New Contributor

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
Valued Contributor III

Re: Expression to background color specific text values

Try this out:

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

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

Re: Expression to background color specific text values

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())

tristan_walters
New Contributor

Re: Expression to background color specific text values

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
Valued Contributor III

Re: Expression to background color specific text values

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
WhatsApp: 24 98152-1675
Skype: justen.thiago
yujiyamane
Contributor II

Re: Expression to background color specific text values

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())

)