Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

General Discussions

Discuss any topics that are not product-specific here.

How do you use <= with numbers in one column to return text in new column?

5 - Atom

This is my first-time using Alteryx and I have a list of numbers that I want to return with a text.  I want anything that is <= to 30 in the Days Since Posted column to return the word Green in the Req status column and anything that is <= 59 in the numbers column to return the word Yellow in the Req status column and anything >59 in Days Since Posted column to return the word Red in the Req status column.  Here is the formula that was suggested to me that I use but it keeps saying I have an error.                     IF [Days Since Posted] <= 30 THEN "Green" ELSEIF [Days Since Posted] <= 59 THEN "Yellow" ELSE "Red" ENDIF                      When I hit Run - it comes back with An expression cannot end with a operator (expression #1)   Any help would be greatly appreciated. 


8 - Asteroid

Your formula seems to work for me. You did not upload example data but is it a string type, rather than numeric? That should give you a different error than what you are getting. I would think you forgot the ENDIF statement at the end but I see you have it.  


To note, be careful about doing else = something as in this case, any null would be coded as "red". I included an example in the flow so you can see what I mean. 


I hope this helps. If so, please mark it as correct/solved! 

5 - Atom

Thank you!