Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am a developer in Qlik Sense facing issue in an expression like:
=If(Condition <= 1 , Green(), Yellow(),
If(Condition <=20 , Yellow(), rgb(255,165,0),
If(Condition <=50 , rgb(255,165,0), Red())))
Need background colors like value less than or equal to 1 % show green color or else yellow() , value less than or equal to 20 % show yellow() or else orange color and at last value less than or equal to 50% show orange color or else red() .
Please help me with this basic error. It would be helpful.
Regards
Ishan.
Hi
Try this
If(Condition <= 1 , green(),If(Condition <=20 , Yellow(), If(Condition <=50 , rgb(255,165,0), Red())))
Hope this helps
Thanks
Hi
Try like below
If(Condition <= 0.01 , green(),If(Condition <=0.20 , Yellow(), If(Condition <=0.50 , rgb(255,165,0), Red())))
Hi Kashyap,
Could you explain to me the if() statement in brief what it's doing?
Hi Mayilvahanan,
Thanks for the query.
Hi
Kashyap and Mayilvahanan I used both expressions in the background tab it showing the wrong background color as shown below.
Please help.
Hi
Can u share the sample file and can u please elaborate on the requirement u need properly.
Thanks
=If(Condition <= 1 , Green(), Yellow(),
If(Condition <=20 , Yellow(), rgb(255,165,0),
If(Condition <=50 , rgb(255,165,0), Red())))
Sol: The If conditions are not correct
Eg: If condition value = 0.5
It satisfies all the conditions(0.5 <=1 , 0.5<=20, 0.5<=50).
So the condition should be .
if Condition <=1 - Green, else
if >1 Condition <=20 - Yellow. else
if >20 Condition <=50 - rgb(255,165,0). else
Red.
=If(Condition <= 1 , Green(),
If(Condition > 1 And Condition <=20 , Yellow(),
If(Condition >20 And Condition <=50 , rgb(255,165,0), Red())))
Hi QLik4asif,
Can this expression be used for comparing 5 different values?
You can also use Pick Match function, which is having better performance than nested if statement