Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JCC
Contributor II
Contributor II

Color expression based on percentage ranges

Hi everyone,

I wanna apply the below expression to color a column of values with different percentages. For example, below 50% the cells show in RED, between 50-80% in BEIGE, 80-100% in Turqoise and finally above 100% in Teal. However, my results had only two colors, RED and TEAL.

Could you please help me to check this expression and see what is wrong?

if([Filing Factor]>0.50, rgb(153,207,205), if([Filing Factor]>0.80, rgb(255,215,154), if([Filing Factor]>1.00, rgb(0,101,128), rgb(134,17,3))))

Thanks a lot!🤗

 

Labels (1)
1 Solution

Accepted Solutions
mruehl
Partner - Specialist
Partner - Specialist

The logic is simply not that what you wanted. the if-statements should be

if fillingfactor <0.5 then red else if fillingfactor>=0.5 AND filligfactor<0.8 the beige if fillingfactor>=0.8 AND filligfactor<1 then Turqoise.

so the whole range is covered from 0 to 1.

 

 

 

View solution in original post

3 Replies
mruehl
Partner - Specialist
Partner - Specialist

The logic is simply not that what you wanted. the if-statements should be

if fillingfactor <0.5 then red else if fillingfactor>=0.5 AND filligfactor<0.8 the beige if fillingfactor>=0.8 AND filligfactor<1 then Turqoise.

so the whole range is covered from 0 to 1.

 

 

 

JCC
Contributor II
Contributor II
Author

It works now ! great. Thanks a lot!

Haley
Contributor
Contributor

Hello, 

I wrote this script based on syntax to highlight for a measure YoY growth as below, but it did not work, Can anyone help me? Thank you so much

//Syntax:

If condition then [ statements ] { elseif condition then [ statements ] } [ else [ statements ] ] end if

//My script

If [YoY Growth % NWS Job] < 0.0 then red
elseif
[YoY Growth % NWS Job] > 0.0 then green
else yellow
end if