Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Traffic Light Gauge

Hi Guys,

I have been struggling to create a Traffic light gauge in a straight table.

What I would like to have, is a traffic light indicating the below.

IF([Variance]<0,RED()

IF([Variance] >0 and [Variance] <1,YELLOW()

IF([Variance]>1 , GREEN())

Variance the label name for an expression which calculates the variance between actual and budget values.  I get an error when creating a IF statement like the above, saying that there's an invalid token.

Nonetheless, I would really love to just have a 3 segment traffic light gauge, where the colours are based on the above.

Can anyone please assist?

Kind regards,

2 Replies
vinieme12
Champion III
Champion III

try below expression

IF([Variance]>1 , GREEN()

          ,IF([Variance]<0,RED(),Yellow() ) )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
effinty2112
Master
Master

Hi Ruan,

Here's an alternative to nested ifs that I think is easier to read but it's really just a matter of taste.

Pick(

Match(

-1,

[Variance]<0,

[Variance]<1,

-1),


Red(),

Yellow(),

Green())


Cheers


Andrew