Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Keep only the first non-null value for each column

oce
5 - Atom

Hello, I have to apply the following transformation on my dataset which consists of many columns (~30):

 

snip.PNG

 

I have tried applying the following multi-row formula:

IF IsNull([Row-1:A]) and !IsNull([A]) THEN [A] ELSE NULL() ENDIF

 

but since it only applies to a single column it doesn't seem feasible to repeat for each column. Is there a way to do this in a more efficient way? 

3 REPLIES 3
Maskell_Rascal
13 - Pulsar

Hi @oce 

 

Here is how you can do it. 

 

Input:

Maskell_Rascal_0-1635781961463.png

 

Workflow:

Maskell_Rascal_1-1635782089083.png

 

Let me know if that works for you. 

 

Cheers!

Phil

 

mceleavey
17 - Castor
17 - Castor

Hi @oce ,

 

a simple bit of pivoting and sampling will do the trick.

I pivoted the data to filter out all nulls in the value columns, then sampled the first of each grouped by name and pivoted back.

 

Simple.

 

mceleavey_0-1635782275497.png

mceleavey_1-1635782290051.png

Hope this helps,

 

M.

 

EDIT: Sorry, I just did this to retrieve ONLY the first ones. If you want to keep it uniform, simply use the recordID field as the group by in the pivot and remove the filter .



Bulien

atcodedog05
22 - Nova
22 - Nova

Hi @oce 

 

My take on it using the multi-row formula tool.

 

Workflow:

atcodedog05_0-1635782562933.png

 

Hope this helps : )

 

Labels