Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Region forumula - What am I doing wrong?

BigDataGeek
8 - 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

3 REPLIES 3
LordNeilLord
15 - Aurora

Hey @BigDataGeek

 

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

 

BigDataGeek
8 - Asteroid

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

LordNeilLord
15 - Aurora
You are very welcome :)
Labels