Hello, I have data that looks like this:
Last Name | First Name | Address | City | State | Zip Code | Phone Number1 |
Smith | John | 1234 Oak Drive | Springfield | OH | 12345 | 111-555-1212 |
[null] | Jane | [null] | [null] | [null] | [null] | [null] |
[null] | Joe | [null] | [null] | [null] | [null] | [null] |
Jones | Jack | 5678 Schlemeel | Milwaukee | WI | 67890 | 222-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 Name | First Name | Address | City | State | Zip Code | Phone Number1 |
Smith | John | 1234 Oak Drive | Springfield | OH | 12345 | 111-555-1212 |
Smith | Jane | 1234 Oak Drive | Springfield | OH | 12345 | 111-555-1212 |
Smith | Joe | 1234 Oak Drive | Springfield | OH | 12345 | 111-555-1212 |
Jones | Jack | 5678 Schlemeel | Milwaukee | WI | 67890 | 222-555-2121 |
Jones | Jason | 5678 Schlemeel | Milwaukee | WI | 67890 | 222-555-2121 |
Jones | Jar Jar | 5678 Schlemeel | Milwaukee | WI | 67890 | 222-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.
Solved! Go to Solution.
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
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:
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |