Alteryx Designer Desktop Discussions

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

Multiple rows 1 row

csh8428
11 - Bolide

I'm pretty new to Alteryx, so I apologize if this is easy and I'm just not figuring it out. 

I have a data set(sample attached) that has the company and all it's employees. Each row has 1 employee. Each company can have any number of employees. I'm trying to get it so that each row has only 1 company with all the EE info in that row.

 

I have this

Company OIDCompany CodeAssociate IDFirst NameLast NameTitleEmailAlternate email
222ABC1234JohnSmithHRBPJohn@gmail.com 
222ABC6789SallyRossReceptionistSally@gmail.comSally2@gmail.com
222ABC4444BobJonesAnalystBob@gmail.com 
222ABC5555StacyRoyalCEOStacy@gmail.com 
333DEF9999JTBlueAdvisorJT@gmail.comJT2@gmail.com
333DEF5555JoeGreenHRBP 2Joe@gmail.com 

 

I want it to look like this

Company OIDCompany CodeAssociate IDFirst NameLast NameTitleEmailAlternate emailAssociate IDFirst NameLast NameTitleEmailAlternate emailAssociate IDFirst NameLast NameTitleEmailAlternate email
222ABC1234JohnSmithHRBPJohn@gmail.com 6789SallyRossReceptionistSally@gmail.comSally2@gmail.com4444BobJonesAnalystBob@gmail.com 

 

I was trying to achieve this using the crosstab tool but, can't quite get it.

 

Thanks for any help!

1 REPLY 1
GiuseppeC
Alteryx
Alteryx

Hi @csh8428,

 

Alteryx will not allow you to have multiple fields with the same name, as field names are actually used as field identifiers (i.e. you can't have 2 'Email' fields, but you can have 'Email_1' and 'Email_2'.

 

The attached solution is not the most elegant one, but it gives you what you want and potentially explains how to use the Cross Tab tool. By the way have a look at the built in examples to learn how to use it (click on the Cross Tab tool from the top palette -> Open Example).

 

Macros would probably avoid the repetition of the cross tab and rename tools, but can I ask you why you want the data in that specific format?

I'm asking because potentially we could approach the problem from a different angle if I know more about your use case.

 

Giuseppe

Labels