Alteryx Designer Desktop Discussions

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

Combine Similar Fields into multiple entries with one field

KyleF
7 - Meteor

I currently have a solution, but I am hoping that someone has a better way than just a lot of "Select" tools, renaming fields, and then a "Union" tool.

 

I have a dataset that generally looks like this:

 

MonthDay1Bill1To1From1Time1B1P2Bill2To2From2Time2B2P3Bill3To3From3Time3B3P
510ABCLAXJFK510ABCSEALAX310ABCSFOSEA310
512DEFSFOSEA310DEFDENSFO310EFGORDDEN301

 

And I would like to get it into a dataset that looks like this:

 

MonthDayBillToFromTimeBP
510ABCLAXJFK510
510ABCSEALAX310
510ABCSFOSEA310
512DEFSFOSEA310
512DEFDENSFO310
512EFGORDDEN301

 

2 REPLIES 2
Prometheus
12 - Quasar

@KyleF I started out with the Transpose tool to flip the data and put the future field names into one field where I could use the RegEx tool to parse out the number as the first character and turn it into an ID field and the rest into a field named Field. Then I used the Cross Tab tool to pivot it back while grouping data on Month, Day, and ID. 

Transpose Data.PNG

RegEx to create ID and FieldNames.PNG

CrossTab to Pivot Back.PNG

Pivot Output.PNG

binuacs
20 - Arcturus

@KyleF Another way of doing this

image.png

Labels