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

Alteryx Designer Desktop Discussions

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

Flattening Data & Dynamically Rename Fields

Nathan_Boynton
7 - Meteor

Hi Everyone! 

 

I am having trouble trying to flatten out some data.

 

I would like to be able to take data that is structured like this:

Nathan_Boynton_2-1626710691725.png

 

 

And output something like this:

Nathan_Boynton_3-1626710759800.png

 

Also, I am trying to have the output's headers in column's D, E, & F to dynamically rename based on the input data's rows 3, 4, and 5. Another way of saying this is that I would like the output columns D, E, F (and more) to be dynamically renamed using the following convention "Bucket - Type - Metric", that uses the labels from the associated input data's rows. 

 

I have attached a spreadsheet with the inputs and outputs to the post. I really appreciate any help! 

2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @Nathan_Boynton 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1626712996158.png

 

1. In input tool configure first row contains data.

2. Using multirow formula split the headers and body into blocks. I am using Juice as seperator.

 

Upper branch

3. Converting columns to rows.

4. Groupby column position and concating the names.

 

Lower branch

3. Converting columns to rows.

4. Joining the names based on column position names.

 

5. Using regex to split the info needed.

6. Using crosstab to convert rows to columns.

7. Using dynamic replace tool to fix the column name.

 

This approach is dynamic.

 

Hope this helps : )

Nathan_Boynton
7 - Meteor

Thank you so much! You helped me solve my issue!

Labels
Top Solution Authors