We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to get a column value when the rest is null or blank?

crazybeauti_ful
8 - Asteroid

Hi,

 

I have 5 columns that I am trying to make into 1. Each row should basically contain the same data but that data can be placed anywhere in Columns 1-5. For example, if row 1 has its value in column 4 then the rest of the columns should be null or blank. My current formula works until column 3 only (not sure why). Any idea?

 

Sample:

Col 1Col 2Col 3Col 4Col 5Expectation
a  a a
 b   b
   c c
 dd dd
  e  e

 

My Formula:

if isnull ([col 1]) then [col 2]

elseif isnull ([col 1]) and isnull ([col 2]) then [col 3]

elseif isnull ([col 1]) and isnull ([col 2])  and isnull ([col 3]) then [col 4]

elseif isnull ([col 1]) and isnull ([col 2])  and isnull ([col 3]) and isnull ([col 4]) then [col 5]

 

else [col 1]

endif

 

Thank you.

3 REPLIES 3
RobertOdera
13 - Pulsar

Hi, @crazybeauti_ful 

 

Try this.

Please mark as an acceptable solution and like, if it works for you.

RNO2_0-1590947166201.png

 

The workflow is attached.

Cheers!

crazybeauti_ful
8 - Asteroid

Hi @RobertOdera ,

 

Thank you so much! Much appreciated!

 

-- crazybeauti_ful

RobertOdera
13 - Pulsar

Your most welcome @crazybeauti_ful !

Labels
Top Solution Authors