Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Transpose/Crosstab selected rows with different number of columns

PANG
6 - Meteoroid

Hi All,

 

I have a table in the format as shown below. Every 3 rows contains registered information of a group of people. Depending on the number of people in a group, the number of column varies. (Original example from post by @aysha6029https://community.alteryx.com/t5/Data-Preparation-Blending/Crosstab-records-based-on-column-names/m-...)

 

Field1Field2Field3Field4
Name HikePeterLance
Address GravetteLondonDC
Telephone 444555666121131324242
NameAlaric  
AddressANZ  
Telephone989876778  
Name MikeRonald 
Address GraniteIndonesia 
Telephone 22288877798992 

 

What I need is to transpose this table into the ideal format like shown below.

ameAddressTelephone
HikeGravette 444555666
PeterLondon1211313
LanceDC24242
AlaricANZ989876778
MikeGranite 22288877
RonaldIndonesia

798992

 

As I am pretty new to Alteryx, hope someone can provide a detail explanation about how I can achieve this.

 

Thanks.

PANG

7 REPLIES 7
JordanB
Alteryx
Alteryx

Hi @PANG

 

Interesting use case here. I have attached a workflow (V 11) with annotations describing the process.

 

pic1.png

 

Thanks to @NickC for his help!

 

Best,

 

Jordan Barker

Solutions Consultant

PANG
6 - Meteoroid

Hi @JorddanB,

 

Thanks for the explanation. However I am a bit lost at the Summarize part.

After Transpose, my table looks like this:

 

transpose.JPG

 

Do you mind to elaborate a bit on the following steps?

 

Thanks,

PANG

JordanB
Alteryx
Alteryx

Hi @PANG

 

I needed to get all the NAME etc. values on one row so they I could transpose them back into one column.

 

If I didn't do this step there would be no way of putting them all in one field per category.

 

Best,

 

Jordan

PANG
6 - Meteoroid

Hi JordanB,

 

Thanks for the clarification.  It worked well for the example case..

 

However, one more "challenge" from me is that I actually have a huge  table ( about 50k names, with phone and address, and the list is getting longer daily), I haven't try the method out with all the data, but I am wondering if this method will work well, especially considering the use of Summarize tool to Concatenate all rows into single string.

 

What do you think?

 

Thanks,

PANG

JordanB
Alteryx
Alteryx

Hi @PANG

 

Yes I expect this to work for the full data set :)

 

Best,

 

Jordan

Joe_Mako
12 - Quasar

One of the things to watch out for in data like this is blank cells, or missing rows. The solution from @JordanB makes the assumption that no cells will be blank, and no rows will be missing. For example, if we delete just the value "ANZ" or just that entire row, then the results will be incorrect.

 

Here is another approach that can handle blank values and missing rows. In this case, I am making the assumption that a Field1 value of "Name" starts a new set of records.

 

transpose.png

 

Hi, I hope somebody is in this thread stii?

 

I am trying to do the same but bit more complicated i have more rows fields in column1 the rest is the same. 

 

Does anyone know why using previous method I am getting mismatched results? I ve tried to conigure it differently.

 

Instead of Name, Adress, Telephone I can have Company, CEO, Adress, Postal Code  or relations and many more....

 

but I download it with API so the set is big and sometimes a company missing TAX ID or CEO and this method did not work? do you know why?you newer know when some row is missing.

 

If somebody could help I could show you how to configure API workflow with authorization and formula to query different fields plus nice filter in return:)

Please help

 

1.PNG2.PNG

3.PNG

Labels