Alteryx Designer Desktop Discussions

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

Formula for two columns

dholder15
7 - Meteor

I'm trying to create a formula that gives the region based on the site. For example, Los Angeles is the site and I want West as the region to be calculated. How would I go about that? Thanks in advance!

2 REPLIES 2
DanielG
12 - Quasar

@dholder15 -- no offense, but your question doesn't really make sense, even with the sample provided.

 

I read it a few times and I just don't see why you would need to accomplish something like that.  A reference table with a join makes more sense especially for something static like geographic locations.  What is the criteria that puts LA in the "West" if it is not location?  Can region change based upon another data point, i.e. a region "West-Top Location" for locations with a lot of sales?  I think if you explain what you want a bit better, you are likely to get a few more responses.  Or maybe there is someone out there that can interpret this a bit better than me.  :)

jrgo
14 - Magnetar

You can use an IF ELSE statement, like below, which is good especially if you have some scenarios where you need to use more than 1 criteria. There is another IF function that is more similar to how you'd write in Excel if preferred

IF [SITE] = 'Los Angeles' THEN 'West'
ELSEIF [SITE] = 'another site' THEN 'this region'
ELSEIF... THEN...
ELSE 'everything else'
ENDIF

 

You can also use a SWITCH() function if it's always just 1 condition

SWITCH([SITE], 'everything else'
, 'Los Angeles', 'West'
, 'another site', 'this region'
)

 

Help doc for more info

https://help.alteryx.com/20223/designer/conditional-functions

Labels