Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Region forumula - What am I doing wrong?

Highlighted
Asteroid

I'm using the formula tool to assign a region to each name.  Here is how it's structured.  The issue I'm having is everything is being called 'East' in the output field, even 'Name 4-6'.

 

Output Column = Region

 

Formula:

 

IF [Field Rep] = 'Name 1'
or 'Name 2'
or 'Name 3'

THEN 'East'

ELSEif [Field Rep] = 'Name 4'
or 'Name 5'
or 'Name 6'
 
THEN 'West'

else 'Unknown'

ENDIF

Highlighted
Alteryx Certified Partner

Hey @Shap

 

Try:

 

IF [Field Rep] in ( 'Name 1', 'Name 2', 'Name 3') THEN 'East'

ELSEif [Field Rep] in ( 'Name 4', 'Name 5', 'Name 6' )THEN 'West'

else 'Unknown'

ENDIF

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

 

Highlighted
Asteroid

Thank you sir!  Worked well and is easier than my previous code.   Didn't know about the 'in' function.

Highlighted
Alteryx Certified Partner
You are very welcome :)
Labels