Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

alekong1
New Contributor

Color in Expression

Newbie here working on an expression in a table. If I want the Yes to be colored green, the No to be colored red, and the N/A to be colored yellow, how do I adjust the below expression?

If(Column(1) < Column(2),
'YES',

if(Column(1) > Column(2),
'NO',

if (column(1) = column(2),
'N/A'

)))

Thanks,

Ale

4 Replies
adityaakshaya
Contributor III

Re: Color in Expression

Hi Ale,

You can use the same expression with little change in the background color for the expression. Below is the change for your reference.

Capture_312018.PNGIf(Column(1) < Column(2),
RGB(0,255,0),

if(Column(1) > Column(2),
RGB(255,0,0),

if (column(1) = column(2),
RGB(255,0,255)

)))

alekong1
New Contributor

Re: Color in Expression

I still need the text "Yes", "No", or "NA" to show up plus background color. How would you edit the expression to include both color and text?

adityaakshaya
Contributor III

Re: Color in Expression

Hi Ale,

Follow the below steps:

Step1:

In the expression definition, you include below expression

If(Column(1) < Column(2),
'YES',

if(Column(1) > Column(2),
'NO',

if (column(1) = column(2),
'N/A'

)))

Step2:

In the left Pane of expression tab, expand the expression as shown in the below snapshot and click the background color and under itsCapture_312018.PNG definition write this

If(Column(1) < Column(2),
RGB(0,255,0),

if(Column(1) > Column(2),
RGB(255,0,0),

if (column(1) = column(2),
RGB(255,0,255)

))).

This will give you text and color both.

Thanks.

alekong1
New Contributor

Re: Color in Expression

Thank you Akshaya! I don't have the exact same view as you while editing the table. But was able to adjust the background color using the expression you provided. I appreciate your help.

Community Browser