Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results 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
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.

Champion

I guessed it.

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

Luminary Alumni

HI,

Try like this

=If(cost > 0, Green(),

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

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

Regards,

jagan.

Specialist III

Dear Tamil,

Condition:

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