Alteryx Designer Desktop Discussions

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

Grouped pivot from rows

knobsdog
8 - Asteroid

I must be losing my mind but I can't seem to figure this out.  I have the below issue with a workflow, unfortunately I can't share the workflow due to data security but here's a generic dataset.  I've tried a multi row formula, summarize and cross tab tools but I'm clearly missing something.

 

Current Output

IDPrimary StateSecondary State
   
78GeorgiaNew Jersey
78GeorgiaArizona
78GeorgiaPennsylvania

 

Expected OutputIDPrimary StateSecondary State 1Secondary State 2Secondary State 3
78GeorgiaNew JerseyArizonaPennsylvania
5 REPLIES 5
DataNath
17 - Castor

Is this what you're after @knobsdog? It just relies on creating a grouped RecordID within each group which you can then make part of the new headers before Cross-tabbing the results:

 

DataNath_0-1666108176155.png

 

This will be fully dynamic to any number of secondary states.

binuacs
20 - Arcturus

@knobsdog One way of doing this

binuacs_0-1666108545080.png

 

knobsdog
8 - Asteroid

Man that was really fast.  Can you show the options selected for the Cross Tab and Transpose, they didn't come over in the download.  That is the output I'm looking for just not sure which options to use to get there.  Thank you for your help.

 

DataNath
17 - Castor

No problem at all @knobsdog, can you show what the download looks like? Seems odd that you cant see configurations etc. Anyway, Transpose:

 

DataNath_0-1666108859798.png

 

Cross-Tab:

 

DataNath_1-1666108885627.png

 

Note on the cross-tab that our [New Header] field will prevent any weird behaviour from the forced aggregation and so we can select any of these options, I always just use concatenate as it's first!

knobsdog
8 - Asteroid

It brought in the workflow but had cleared out the options in those two tools for some reason.  Not sure if it's a version difference thing but that helped.  I'm able to get to the output I needed because of this.  Thank you so much for your quick help.

Labels