Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

soniasweety
Contributor III

color code

Hi all

I have a gauge chart   with  expression   so same I have to show in   table box with bg color

so how can I use?

expression I have placed in variable

vMyExpression  =This expression is big so I  want to use variable in bg colour

logic:     0-80% red,  80%-90% amber   >90% green

Tags (1)
1 Solution

Accepted Solutions
pooja_prabhu_n
Contributor III

Re: color code

Hi,

variable can not hold multiple values.If the expression is big you can perform the calculations at script level.

with your expression you can try something like below.

=if(vMyExpression>90,RGB(0,204,0),if(vMyExpression>=80 and vMyExpression<=90,RGB(255,255,0),if(vMyExpression<80,RGB(255,0,0))))

Thanks,

Pooja

3 Replies
pooja_prabhu_n
Contributor III

Re: color code

Hi,

variable can not hold multiple values.If the expression is big you can perform the calculations at script level.

with your expression you can try something like below.

=if(vMyExpression>90,RGB(0,204,0),if(vMyExpression>=80 and vMyExpression<=90,RGB(255,255,0),if(vMyExpression<80,RGB(255,0,0))))

Thanks,

Pooja

vvira1316
Valued Contributor II

Re: color code

Following may help

Relative Text Color expression

May be your vMyExpression evaluation is going wrong.

soniasweety
Contributor III

Re: color code

thanks its working now

Community Browser