Free Trial

Alteryx Designer Desktop Discussions

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

Union Tool/Stacking Data

reginawhelan
8 - Asteroid

Hi, I would like to stack data that is within one data source. I would like for the Names and DOB's be stacked into 3 columns instead of 9 with the Identifier carried over for each person. The following is an example of the current and desired output:

 

Current
IdentifierPerson #1 First NamePerson # 1 Last NamePerson #1 DOBPerson #2 First NamePerson # 2 Last NamePerson #2 DOBPerson #3 First NamePerson # 3 Last NamePerson #3 DOB
123Name1Last Name11/10/1978Name5Last Name51/10/1978Name9Last Name91/10/1978
124Name2Last Name21/11/1978Name6Last Name61/11/1978Name10Last Name101/11/1978
125Name3Last Name31/12/1978Name7Last Name71/12/1978Name11Last Name111/12/1978
126Name4Last Name41/13/1978Name8Last Name81/13/1978Name12Last Name121/13/1978
          
Desired      
IdentifierFirst NameLast NameDOB      
123Name1Last Name11/10/1978      
124Name2Last Name21/11/1978      
125Name3Last Name31/12/1978      
126Name4Last Name41/13/1978      
123Name5Last Name51/10/1978      
124Name6Last Name61/11/1978      
125Name7Last Name71/12/1978      
126Name8Last Name81/13/1978      
123Name9Last Name91/10/1978      
124Name10Last Name101/11/1978      
125Name11Last Name111/12/1978      
126Name12Last Name121/13/1978      

  

10 REPLIES 10
JosephSerpis
17 - Castor
17 - Castor

Hi @reginawhelan I mocked up an approach to tackle this. Let me know what you think?

reginawhelan
8 - Asteroid

Thank you so much! I think this will work, I just need some help with the RegEx formula. The titles in my example were not the actual titles. The Actual titles are:

 

Spouse Information - First Name

F44 - Last Name

F45 - DOB

F46 - Gender

Dependent Child 1 - First Name

F48 - Last Name

F49 - DOB

F50 - Gender

F51 - Other Info

Dependent Child 2 - First Name

F53 - Last Name

F54 - DOB

F55 - Gender

F56 - Other Info

etc... 

 

Can you help?

reginawhelan
8 - Asteroid

Sorry. I want to mention that the titles are just the data before the dash, for example (Spouse Information, F44, F45, F46). the data after the dash is what the information is.

 

Spouse Information - First Name

F44 - Last Name

F45 - DOB

F46 - Gender

Dependent Child 1 - First Name

F48 - Last Name

F49 - DOB

F50 - Gender

F51 - Other Info

Dependent Child 2 - First Name

F53 - Last Name

F54 - DOB

F55 - Gender

F56 - Other Info

JosephSerpis
17 - Castor
17 - Castor

Hi @reginawhelan can you provide a mock example file with how the columns name appear exactly in your data would be easier to work with.

reginawhelan
8 - Asteroid

Thanks again for you time and help. The attached spreadsheet includes the actual titles. I should also mention that sometimes cells are blank and that's ok.

Ben_H
11 - Bolide

Hi @reginawhelan,

 

I've attached a potential solution for you. I can't help but feel it's a little over complicated but it seems to meet your requirements.

 

Be sure to read the included commentary.

 

Regards,

 

Ben

reginawhelan
8 - Asteroid

Hi, unfortunately I can't open your example as it is in a newer version of Alteryx. Is there a way you can send it in Alteryx Designer x64?

JosephSerpis
17 - Castor
17 - Castor

Hi I amended the workflow using your sample data you provided. Let me know what you think?

Ben_H
11 - Bolide

Hi @reginawhelan,

 

Just in case you run into the version issue in future -

 

If you right click on the yxmd file and open with notepad you will see the xml for the routine.

 

Ben_H_0-1600940308938.png

 

At the top you'll see "<AlteryxDocument yxmdVer=..." If you change the value in quotes from 2020.2 to match your version of alteryx and then save you should then be able to open the file.

 

Regards,

 

Ben

Labels
Top Solution Authors