I have two issues I am looking to address and am unsure about how to go about it.
1. The data source I am working with has multiple headings in one column (just how it exports from a program). It also displays the same heading multiple times per the below example (Accom then 2 rows of data, Accom followed by 2 rows of data etc). Is there a tool or formula in Alteryx that can bring these from the column above the data to the row beside the data in a new column?
From
Field 1 | Field 2 |
Accom | Null |
Name 1 | 45 |
Name 2 | 40 |
Accom | Null |
Name 3 | 45 |
Name 4 | 40 |
Bar Sales | Null |
Name 1 | 30 |
TO
Field 1 | Field 2 | Field 3 |
Accom | Name 1 | 45 |
Accom | Name 2 | 40 |
Accom | Name 3 | 45 |
Accom | Name 4 | 40 |
Bar Sales | Name 1 | 45 |
Bar Sales | Name 2 | 40 |
2. Formula to replace null value with the previous Non-Null value in the same column so as to have the A/C Types displayed in the same row as the data per the below.
From
Field 1 | Field 2 | Field 3 |
A/C Type 1 | Null | Null |
Null | Name 1 | 10 |
Null | Name 2 | 15 |
A/C Type 2 | Null | Null |
Null | Name 3 | 10 |
Null | Name 4 | 15 |
To
Field 1 | Field 2 | Field 3 |
A/C Type 1 | Name 1 | 10 |
A/C Type 1 | Name 2 | 15 |
A/C Type 2 | Name 3 | 10 |
A/C Type 2 | Name 4 | 15 |
Solved! Go to Solution.
Create a new field. Then set the value to equal Field 1 when Field 2 is null, else null. Then perform a multi row formula on the new field to fill the nulls down until a non-null value is reached.
Then filter out rows with Null in field 2.
Both cases can be solved using the Multi-Row Formula tool. The solutions are below as well as a workflow attached.
Flow 1:
Result 1:
Flow 2:
Result 2:
Thanks for your answer, this has worked well!
The only issue I have is that the new column is not pulling across the heading for the first 20 cells as the Heading is actually a heading of the column. Is there anyway to pick this up in the formula also?
You can use the transpose tool then join it back with the first column data to end with the header as a new column per the below:
Flow:
Input:
Result:
Join: