Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Multiple rows to multiple columns

felipeecst
7 - Meteor

Hi everyone,

 

I have the following table:

 

ItemAttr1Attr2Attr3
AXWR
BYZS

 

I want to transform it into the following:

 

ItemA-Attr1A-Attr2A-Attr3B-Attr1B-Attr2B-Attr3
AXWRYZS

 

 

I was able to do that by using multiple Crosstabs and Append Fields in sequence (example attached), but I believe there is a more elegant way to do this. Also, the number of attributes can grow and this approach would become unmanageable. 

 

Can anyone help me finding a better solution?

 

Thanks in advance!

 

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

I'd suggest something like:

 

- Transpose to get Item, Name, Value

- Then Formula Tool to join Item to Name

- Finally a Cross Tab to convert to the horizontal form.

 

2016-05-03_20-35-26.jpg

 

This doesn'r result in the initial Item column though. Sample attached.

felipeecst
7 - Meteor

That's exactly what I needed :)

 

Thank you!

Labels