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.

IF Condition

rmartinez4
8 - Asteroid

Hi all,

 

How to find the write a condition if column1 is blank then give me the next column2 now if comlun2 is still blank then give me column3. Now if all column its still blank then give me column1.

 

Thank You,

3 REPLIES 3
binuacs
21 - Polaris

@rmartinez4 You can write something like the below. If it is not working please provide some sample data and expected output

 

binuacs_0-1661376870374.png

 

DataNath
17 - Castor
17 - Castor

May be a slightly drawn out way of doing it, but the following approach ought to be dynamic if you were to add any amount of fields to this i.e. if you had 1,000 columns and just needed to return the first non-null.

 

DataNath_0-1661376900841.png

ChrisTX
16 - Nebula
16 - Nebula

Do you have only 3 columns, or more than 3?

 

Use the Formula tool to create a new field 

 

IF IsEmpty([my field 1]) and IsEmpty([my field 2]) AND IsEmpty([my field 3]) THEN Null()

ELSEIF IsEmpty([my field 1]) THEN [my field 2]

ELSE [my field 1]

ENDIF

Labels
Top Solution Authors