Alteryx Designer Desktop Discussions

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

If multiple Rows, combine into one

arnettmh
7 - Meteor

I have data that looks similar to the following:

 

IDRegionNameOrder CountType
1003NorthBob Jones5Primary
1004WestJim Cobbler7Primary
1004 EastJim Cobbler3Secondary
1005NorthPatricia Smith8Primary
1005CentralPatricia Smith2Secondary

 

I want to have a single row by ID where we would have a Primary Region with a total order count for the Primary Region and then a Secondary Region with a total order count for the Secondary Region.  At most, there are only ever 2 rows by ID.  So, there will always be either 1 or 2 rows per ID.

 

Want to end up with something like this:

 

IDNamePrimary RegionPrimary Region Order CountSecondary RegionSecondary Region Order Count
1003Bob JonesNorth5NullNull
1004Jim CobblerWest7East3
1005Patricia SmithNorth8Central2
      
3 REPLIES 3
binuacs
20 - Arcturus

@arnettmh One way of doing this with the Join tools

 

binuacs_0-1678392866110.png

 

arnettmh
7 - Meteor

Thanks @binuacs , this worked well for me.  I was trying to use the Transpose tool and Cross Tab tool, but this was a simpler method.

BS_THE_ANALYST
14 - Magnetar

@arnettmh I added some extra data to try and show you how to future proof your work if you come across this scenario again.

BS_THE_ANALYST_0-1678402464487.png

You just need to keep adding another layer by adding another Filter tool iteratively. 

Cool tip, to help with the renames, inside the options of join tools you can clear all renames, and then highlight the ones you want to add the prefix to i.e. Primary, Secondary, etc. Makes it so much easier for renaming.

BS_THE_ANALYST_1-1678402732790.png

 

 

Labels