Alteryx Designer Desktop Discussions

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

Transformation

anwerm2
7 - Meteor

Hi

I have been trying to transform a table but not getting my desired result. Could some one please help me or provide any specific tools available in Alteryx. I have attached the excel file which has two tabs  Sheet1 is table and result is what I want. Thank you in advance.

Regards

M. Anwer

DMtreeBU_DM1BU_DM1RC_DM2RC_DM2ACC_DM3ACC_DM3
100610ABAAB     
100919ACAAC     
101129ADAAD     
20000  BABAA   
20487  BBBAB   
20623  BCBAC   
30102    CACAA 
31000    CBCAB 
31002    CCCAD 

Result I want

treeBU_DM1BU_DM1treeRC_DM2RC_DM2treeACC_DM3ACC_DM3
00610ABAAB0000BABAA0102CACAA
00919ACAAC0487BBBAB1000CBCAB
01129ADAAD0623BCBAC1002CCCAD
7 REPLIES 7
MilindG
12 - Quasar

See if this works

danilang
19 - Altair
19 - Altair

Hi @anwerm2 

 

Here's a dynamic way to do this that avoids having to change the workflow if the number of DMs changes

 

danilang_1-1679140422420.png

After removing the null rows from the input data, use a MultiRow formula tool to add the row number that will be in your final output.  Transpose, Remove the null values and build the renumbered "Tree" column headers.  The next Multi-Row formula tool is there to add in columns numbers to compensate for the fact that the Crosstab will create the columns in alphabetical order if you use the final column names directly in the tool.  The final Dynamic Rename tool just renames the columns from the numbers to final output column names 

 

danilang_2-1679140782316.png

 

Dan

 

 

 

KimLamNg
8 - Asteroid

I renamed the input headers a bit but the logic should still be applicable.

Spoiler
KimLamNg_0-1679152744381.png

 

 

KimLamNg
8 - Asteroid

@danilang I really like the way you set up the column number so that the order is retained after the Cross tab. I was struggling with it.

anwerm2
7 - Meteor

Kim you are GREAT

My columns were wrong headings. For each dimension it was level 1 and level 2. Kim corrected it.  Thank you

Danilang solution was also good and dynamic.

prakashkaur189
6 - Meteoroid

This is my 1st used case. It was hard for me to understand and bring the data in a particular layout but I am happy to solve it in the last. I have used quite basic tools and have kept it simple. My code is updated here for reference,

anwerm2
7 - Meteor

Thank you

Labels