Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Conditional formatting using basic table tool

gjlomuti
6 - Meteoroid

Hi I am trying to create an IF statement to create conditional formatting for cells and my formula is giving me issues. My conditional formatting is aiming to make any values less than .5 a green background, any values between .5 and 1 to be yellow, and any values above 1 to be red, and any values that are zero to have no formatting. 

 

This is what I have so far but it isnt giving me the right output when i do some calculations by hand:

 

IF [entire pop variance] <= .5 THEN "background-color: green;" ELSEIF [entire pop variance] < 1 THEN "background-color: yellow;" ELSE "background-color: red;" ENDIF

 

 

Would appreciate any guidance!

 

Thanks

 

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@gjlomuti 
I think we can use Table Setting and Row Setting for your case.

Refer to attachment for details.

Capture1.PNGCapture2.PNG

CharlieS
17 - Castor
17 - Castor

Could you expand on "isnt giving me the right output when i do some calculations by hand"? What about the results isn't right? This could help troubleshooting. If nothing else you might want to change it a bit to add the no formatting condition for 0 values you described:

 

IF [entire pop variance] = 0 THEN ""

ELSEIF [entire pop variance] <= .5 THEN "background-color: green;"

ELSEIF [entire pop variance] < 1 THEN "background-color: yellow;"

ELSE "background-color: red;" ENDIF

 

I used the expression above as a Column rule and it seems to work just fine. Let me know if this isn't the case for you.

20210309-TableFill.JPG

 

If you're still having trouble, you could go about this the "long way" and create a variable for the color fill before the Table tool to make sure you have the none/green/yellow/red assignment working properly, then use that field value for the column rule.

Labels