Alteryx Designer Desktop Discussions

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

Trying to Input Data from One of Two Columns into Another Column

StrategyMan
5 - Atom

Hi Alteryx!

 

In a need of a little help here...

 

I am creating a new category that should integrate data from one of two other columns. 

 

For example:

 

S CompanyV NameS Name (New Category)
XYZ[Null]XYZ
ABCGEFGEF

[Null]

HIJHIJ

[Null]

[Null] 

 

Essentially, I want the new column "S Name" to always take from the "V Name" column unless it is null. If the "V Name" column is null, it should just take data from the "S Company" column. If both are null, then "S Name" will remain blank.

 

I'm assuming it has something to do with the formula tool but I haven't found the right formula.

 

Any help would be appreciated.

 

Best,

StrategyMan

2 REPLIES 2
DiganP
Alteryx Alumni (Retired)

@StrategyMan You would have to use a conditional statement in the formula tool. I think this formula should do the trick 

 

IF [V Name]=null() THEN [S Company] ELSEIF [V Name]=null() AND [S Company]=null() THEN null() else [V Name] ENDIF

Digan
Alteryx
echuong
8 - Asteroid

See the attached workflow, this should work for your purpose. You'd just have to replace the text input with your actual input file, then adjust the field names in the formula. Let me know if you need help!

Labels