Alteryx Designer

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

Multiple rows and columns to single row

Highlighted
7 - Meteor
Hello. I've searched the community site, but have not quite found the answer I'm seeking. I have multiple rows and columns and want to transpose it into one continuous row. Before name year currate newrate George 10 0.1000 0.1099 20 0.2000 0.2099 30 0.3000 0.3099 After name year currate newrate year1 currate2 newrate2 year3 currate3 newrate3 George 10 0.1000 0.1000 20 0.2000 0.2099 30 0.3000 0.3099 I want the rows with year 20 and year 30 appended to the first row along with headers incremented by 1. The number of rows could vary. I appreciate your help and thanks in advance for your help. Victor
Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @kcvictor 

 

Could you please post a sample of your Input and desired output (in table format), so we can picture the situation more easily?

 

Cheers, 

Highlighted
7 - Meteor
I've attached a spreadsheet showing the before and after. Please see attached.
Highlighted
11 - Bolide

Hey @kcvictor,

 

The attached uses the transpose, record count, and cross tab tools to do this. The only downside is that I had to re sort the column names at the end. You could get around that though with a more complex formula in the formula tool.

 

Best,

mmenth

Highlighted
14 - Magnetar
14 - Magnetar

Hi @kcvictor 

 

The trick is to include a numeric column for your crosstab tool, and then a dynamic rename to pull in the actual column headers. Otherwise, the Crosstab tool alphabetizes your letters.

 

image.png

 

The name is generated by adding the record id minus 1 to the existing field names (in the Name2 column out of the Transpose tool)

A second Record ID tool generates the column ID used by the Crosstab tool, and a Dynamic rename matches in the headers.

 

Let me know if this helps. Workflow is attached.

 

Cheers!

Esther

Highlighted
7 - Meteor
Thank you EstherB47. This closest to what I was trying to achieve. I wish to thank everyone for their help.
Labels