Alteryx Designer Desktop Discussions

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

Multiple Headings in One Column

TomH1
6 - Meteoroid

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 1Field 2
AccomNull
Name 145
Name 240
AccomNull
Name 345
Name 440
Bar SalesNull
Name 130

 

TO

 

Field 1Field 2Field 3
AccomName 145
AccomName 240
AccomName 345
AccomName 440
Bar SalesName 145
Bar SalesName 240

 

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 1Field 2Field 3
A/C Type 1NullNull
NullName 110
NullName 215
A/C Type 2NullNull
NullName 310
NullName 415

 

To

 

Field 1Field 2Field 3
A/C Type 1Name 110
A/C Type 1Name 215
A/C Type 2Name 310
A/C Type 2Name 415
4 REPLIES 4
Inactive User
Not applicable

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. 

JoshKushner
12 - Quasar

Both cases can be solved using the Multi-Row Formula tool. The solutions are below as well as a workflow attached.

 

Flow 1:

s1 flow.PNG

 

Result 1:

s1 result.PNG

 

Flow 2:

s2 flow.PNG

 

Result 2:

s2 result.PNG

TomH1
6 - Meteoroid

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?

 

 

JoshKushner
12 - Quasar

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:

header data.PNG

 

Input:

Input.PNG

 

Result:

output.PNG

 

Join:

Join.PNG

Labels