Alteryx Designer Desktop Discussions

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

Creating a formula based on a column existing or not

nbryanrh
5 - Atom

Hi All,

 

I am quite new to this community, having an issue processing a report whose column might differ on every run. For example:

 

Col ACol BCol C
ABCDEFGHI

 

Sometimes all three columns exist, or sometimes only column B exists, etc.

 

I'd like to create a new column with the following logic:

 

IF (col A exists) THEN [col A]

ELSEIF (col B exists) THEN [col B]

ELSEIF (col C exists) THEN [col C]

ELSE null( )

ENDIF

 

For example, if only Col B & Col C exists, the value taken should be from Col B. How would this be possible? Thanks for your help!

1 REPLY 1
Qiu
20 - Arcturus
20 - Arcturus

@nbryanrh 
I think we need to "force" all the column to be present even when they are not. 😀

I created another input file which contains only all the columns then do a union/

0419-nbryanrh-01.PNG0419-nbryanrh-02.png

Labels