Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to set RGB for negative values

I have this column called cost and I have to set rgb based on the below criteria.

If cost > 0 then Green

if Cost = 0 to -5 then Yellow and if Cost < - 5 then Green.

How can I write this in calculated condition in color ?

Thank you.

5 Replies
tamilarasu
Champion
Champion

Hi,

Try below expression,

If(cost >0 or cost <-5 , LightGreen(), Yellow())

Not applicable
Author

My bad...below is what I want.

If cost > 0 then Red

if Cost = 0 to -5 then Yellow and if Cost < - 5 then Green.

tamilarasu
Champion
Champion

I guessed it. 

If(cost>0, Red(), If(cost <= 0 and cost >=-5, Yellow(), If(cost <-5, Green())))

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

=If(cost > 0, Green(),

if(cost >= 0 AND cost <= -5, Yellow(),

if(cost < - 5, Green())))

Regards,

jagan.

engishfaque
Specialist III
Specialist III

Dear Tamil,

Here is a condition for your RGB Colors, please use

Condition:

=If(Cost > 0, Red(), If(Cost < (-5), Green(), Yellow()))

Your Requirement:

If cost > 0 then Red

if Cost = 0 to -5 then Yellow and if Cost < - 5 then Green.

Kind regards,

Ishfaque Ahmed