Free Trial

Alteryx Designer Desktop Discussions

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

How to use cross tab to transform data

wuaw
7 - Meteor

Hi team,

 

I have this set of data below:

wuaw_7-1616652184064.png

 

 

The desired format is this:

 

wuaw_2-1616651907821.png

 

I have using transpose and formula tool to try to manipulate the data. I think the next step is to use cross-tab, but I am not able to get the desired output format. Please suggest anything if you can think of a smarter solution than my current workflow. Thanks!

 

Screenshot of transpose tool:

 

wuaw_3-1616652015027.png

 

wuaw_4-1616652029443.png

 

 

Screenshot of formula tool:

 

wuaw_5-1616652046191.png

 

wuaw_6-1616652058049.png

 

 

 

 

 

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@wuaw 
I hope this works for you.

Capture4A.PNG

danilang
19 - Altair
19 - Altair

Hi @wuaw 

 

Here you go

 

danilang_0-1616674137835.png

 

Once your data is transposed, use a Regex Parse tool to separate the column header from the type.  You can also use a Formula tool with substring/findstring combinations instead of the regex.  After this you can use a Cross Tab.  This changes the output column order and replaces spaces in column names with underscores as shown in the top container.

 

To keep the underscores and column order add a Multirow tool to build the unique column numbers.  Cross Tab with the column numbers as headers, since the new columns get placed in numerical order.  Use a Dynamic Rename to change the numbered columns to the original column names.  the bottom Summarize build a list of unique column names and numbers that the Dynamic Rename uses to perform the substitution.

 

Dan

Labels
Top Solution Authors