Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

IF Formula with Multiple Targets

katherinetdavita
8 - Asteroid

I'm trying to create a formula for a set of demographic information to capture which people live and/or work in a set of specified counties and I've tried multiple variations of IF formulas with no success.

 

Here's some sample data. I'm trying to populate a new column called "Live/Work in Selected County" based on the work and home county fields. The four selected counties are Dutchess, Putnam, Rockland, and Westchester.

 

katherinetdavita_0-1613070072411.png

 

Looking for help with the syntax in the formula tool.

 

2 REPLIES 2
markcurry
12 - Quasar

Hi @katherinetdavita  , I think the following formula should work for you...

 

IF [Work County] IN ("Dutchess","Putnam","Rockland","Westchester") AND [Home County] IN ("Dutchess","Putnam","Rockland","Westchester") THEN 
	"Live & Work"
ELSEIF [Work County] IN ("Dutchess","Putnam","Rockland","Westchester") THEN 
	"Work"
ELSEIF [Home County] IN ("Dutchess","Putnam","Rockland","Westchester") THEN 
	"Live"
ELSE
	Null()
ENDIF
katherinetdavita
8 - Asteroid

Ah, that's amazing!! Thanks so much.

Labels
Top Solution Authors