Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Different traffic light bounds based on dimension value

Hello,

I'm trying to write some logic for a traffic light within one of my tables (below). Basically, I want to set different bounds for what defines red, yellow, and green for EE Paid, ER Paid, and Other. Specifically, EE Paid should be green if Column 3 is >= 0.32 and yellow if Column 3 is between 0.28 and 0.31, and red otherwise. ER Paid should be green if Column 3 is >=0.04, yellow if Column 3 is greater than 0.02 but less than 0.04, and red otherwise. Other should be the same bounds as ER paid. I have the below code, but it's not working. Thanks for your help!

example.JPG

Code for Bounds:

Red: 0

Yellow: if(Payer='EE Paid', 0.28, if(Payer='ER Paid', 0.03, 0.03))

Green: if(Payer='EE Paid', 0.32, if(Payer='ER Paid', 0.04, 0.04))

1 Solution

Accepted Solutions
sunny_talwar

Is this the goal?

Capture.PNG

Expression:

=If(Payer = 'EE Paid',

If(Column3 < 0.28, 'qmem://<bundled>/BuiltIn/led_r.png',

If(Column3 < 0.31, 'qmem://<bundled>/BuiltIn/led_y.png', 'qmem://<bundled>/BuiltIn/led_g.png')),

If(Payer = 'ER Paid',

If(Column3 < 0.02, 'qmem://<bundled>/BuiltIn/led_r.png',

If(Column3 < 0.04, 'qmem://<bundled>/BuiltIn/led_y.png', 'qmem://<bundled>/BuiltIn/led_g.png'))))

View solution in original post

2 Replies
sunny_talwar

Is this the goal?

Capture.PNG

Expression:

=If(Payer = 'EE Paid',

If(Column3 < 0.28, 'qmem://<bundled>/BuiltIn/led_r.png',

If(Column3 < 0.31, 'qmem://<bundled>/BuiltIn/led_y.png', 'qmem://<bundled>/BuiltIn/led_g.png')),

If(Payer = 'ER Paid',

If(Column3 < 0.02, 'qmem://<bundled>/BuiltIn/led_r.png',

If(Column3 < 0.04, 'qmem://<bundled>/BuiltIn/led_y.png', 'qmem://<bundled>/BuiltIn/led_g.png'))))

Not applicable
Author

Perfect! Thank you!