In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
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
binu_acs
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