Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Pivot Table (Multi-Fields)

knnwndlm
8 - Asteroid

Hi SME,

 

I would like to create a pivot table similar to Excel in Alteryx as shown in the attached file.  The Source tab is the raw data and the Desired Output tab is the pivot table.  

Could you please help me figure out a way to do this?  I can do it if I only have one number field. For some reasons, I'm not able to get the two number fields to work.

 

Thanks,

kwl

13 REPLIES 13
binuacs
21 - Polaris

@knnwndlm the below weekly challenge gives you an idea about the pivot part in Alteryx

 

https://community.alteryx.com/t5/Weekly-Challenge/Challenge-292-It-s-about-Pivoting-Prepping-and-Rep...

 

ShankerV
17 - Castor

Hi @knnwndlm 

 

I believe this is very similar to the solution already provided in another thread of yours.

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Data-Summary/td-p/1050871

 

While creating the below using summarize tool also add the IA column in addtion.

 

ShankerV_0-1671554067705.png

 

Many thanks

Shanker V

 

knnwndlm
8 - Asteroid

Hi @ShankerV!

 

Yes, it's very similar, but I'm unable to get it to work properly.  I did use the Summarize Tool for both IA and State and then Crosstab Tool for the State.  This is where I get stuck with using the Crosstab tool again for IA.  Clearly, I need to use IA in the Values for New Columns, but I'm not sure what to put under the Change Column Headers.

 

Thanks,

kwl

ShankerV
17 - Castor

Hi @knnwndlm 

 

Please find the expected output. From the below you can use the previous workflow to integrate and get the result.

 

ShankerV_0-1671556560030.png

 

 

ShankerV_1-1671556571941.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @knnwndlm 

 

Step 1: Input.

ShankerV_0-1671556656913.png

 

Step 2: filter tool

ShankerV_1-1671556673546.png

 

Step 3: dynamic tool

ShankerV_3-1671556744184.png

 

Step 4: Dynamic tool

ShankerV_4-1671556759366.png

 

Step 5: Join tool

ShankerV_5-1671556791604.png

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @knnwndlm 

 

Step 6: Union tool

ShankerV_0-1671556848686.png

 

ShankerV_1-1671556874923.png

 

Step 7: Select tool

ShankerV_2-1671556896021.png

 

Step 8: Formula tool

tonumber([Arizona Activities])+tonumber([California Activities])

 

tonumber([Arizona IA])+tonumber([California IA])

 

ShankerV_3-1671556927298.png

 

 

Output:

ShankerV_4-1671556967438.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @knnwndlm 

 

Please find the final output of the Pivot table

 

ShankerV_0-1671557788318.png

Joined with the output and got the result.

ShankerV_1-1671557848802.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

knnwndlm
8 - Asteroid

Hi @ShankerV 

 

Thank you for your help.  I'm still unable to follow it through completely.  Would it be possible for you to put it in a workflow?  

 

Many thanks,

Konn

ShankerV
17 - Castor

Hi @knnwndlm 

 

Sure, give me sometime, unable to save the workflow due to below error.

ShankerV_0-1671558713904.png

 

Will get it sorted now.

 

Many thanks

Shanker V

Labels