Start Free Trial

Alteryx Designer Desktop Discussions

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

Use Multi Field tool to populate null values with value in previous cell

Rob48
8 - Asteroid

Hello, I have data that looks like this:

 

Last NameFirst NameAddressCityStateZip CodePhone Number1
SmithJohn1234  Oak DriveSpringfieldOH12345111-555-1212
[null]Jane[null][null][null][null][null]
[null]Joe[null][null][null][null][null]
JonesJack5678 SchlemeelMilwaukeeWI67890222-555-2121
[null]Jason[null][null][null][null][null]
[null]Jar Jar[null][null][null][null]

[null]

 

 

and I need to process it so that the null  values are replaced with the value in the previous cell in every field, like this:

 

Last NameFirst NameAddressCityStateZip CodePhone Number1
SmithJohn1234  Oak DriveSpringfieldOH12345111-555-1212
SmithJane1234  Oak DriveSpringfieldOH12345111-555-1212
SmithJoe1234  Oak DriveSpringfieldOH12345111-555-1212
JonesJack5678 SchlemeelMilwaukeeWI67890222-555-2121
JonesJason5678 SchlemeelMilwaukeeWI67890222-555-2121
JonesJar Jar5678 SchlemeelMilwaukeeWI67890222-555-2121

 

I've been using the Multi-Row tool to update the existing field with this formula:

 

if isnull ([Last Name]) then [Row-1:Last Name] else [Last Name] endif

 

but with many fields it's a bit tedious to set up.  is there a way to use the Multi-Field tool to accomplish the same thing all at once? I"ve looked through the site but i only see solutions for one field at a time using the multi-row tool.

 

 

I use the multi field tool quite frequently with many saved expressions, for example converting empty to null by:

 

IF isempty([_CurrentField_]) THEN null() ELSE [_CurrentField_] ENDIF

 

would love to utilize the Multi-Field tool for this.

 

Thanks for any help you can provide.

2 REPLIES 2
DataNath
17 - Castor
17 - Castor

Hey @Rob48@patrick_digan developed a macro some time ago that combines the functionality of both the Multi-Row and Field Formula tools. Can be downloaded from the gallery here: Multi-Row -Field -Column Macro example - Alteryx Community

Peachyco
11 - Bolide

@Rob48

I would use the Transpose Tool to put all the values into a column and apply the Multi-Row Formula Tool to that column. Then, I'd use Cross-Tab to bring the table back to its original structure, like so:

Alteryx screenshot.png

Labels
Top Solution Authors