Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Adding Additional Column from Formula

chughes49
8 - Asteroid

I currently have this

Fac NameMonthActMonthVar
Main2345412
Elk23542312
ein 213123
emc412142

 

I am trying have this though:

where there is a new column (Entity)

and if fac name=main Philly

and if facname=elk than it gives Mont

 

I am stuck right here:

IF([Fac name] IN(Main) THEN 'Philly')

 

Thanks!!

EntityFac NameMonthActMonthVar
PhillyMain2345412
PhillyElk23542312
Montein213123
Montemc412142

 

4 REPLIES 4
DataKyle
8 - Asteroid

So you need something like this?

 

IF([Fac Name] = 'Main') THEN 'Philly'

ELSEIF([Fac Name] = 'Elk') THEN 'Mont'

ELSE NULL ENDIF

 

You can also add other options before the last else if needed.

bpatel
Alteryx Alumni (Retired)

try this

 

if [Fac Name] = "Main" OR [Fac Name] = "Elk" then "Philly" else "Mont" endif

 

hope this helps.

 

chughes49
8 - Asteroid

Is it possible to return an empty value instead of null?

bpatel
Alteryx Alumni (Retired)

Yes instead of writing null in the formula just add "" (empty quotation marks).

Labels