Start Free Trial

Alteryx Designer Desktop Discussions

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

Transposition of unique values to a limited number of columns

Marceli_Szadowiak
6 - Meteoroid

Hello All,

 

I have a question that is closely related to one posted and solved here 

 

Now I would like to find a solution for an initial contact data input which looks like this:

Customer no.Contact typeValuePrimary account for multiple-account contacts
123Emailabc@email.comYES
123Emaildef@email.comN/A
123Emailghi@email.comN/A
123Phone111-111-111YES
123Phone222-222-222N/A
123Phone777-777-777YES
222Emailabc@email.comNO
222Phone777-777-777NO
222Phone777-777-777NO
333Emailabc@email.comNO
444Emailabc@email.comNO
555Phone777-777-777NO
666Phone111-111-111NO
456Emailjkl@email.comN/A
456Emailmno@email.comN/A
456Phone333-333-333N/A
789Emailprs@email.comYES
789Emailtuv@email.comYES
789Emailwxy@email.comYES
789Emailzzz@email.comYES
789Phone444-444-444YES
789Phone555-555-555YES
789Phone666-666-666YES
999Emailprs@email.comNO
999Emailtuv@email.comNO
999Emailwxy@email.comNO
999Emailzzz@email.comNO
999Phone444-444-444NO
999Phone555-555-555NO
999Phone666-666-666NO

 

The output has to be formatted in accordance with the following rules:

 

1. there can be no duplicate contacts in the output file

2. if a contact (either an email or a phone number) is shared by more than one account, the account indicated as the Primary account for that contact is to be retained in the Customer no. column and all the remaining accounts sharing that contact need to be indicated in consecutive Relationship columns.

3. each row can hold 1 email and up to 2 phone numbers. 

Based on the rules stated above, the output file should look like this:

 

Customer no.Phone1Phone2EmailRelationship1Relationship2Relationship3
123  abc@email.com222333444
123  def@email.com   
123  ghi@email.com   
123111-111-111  666  
123222-222-222     
123777-777-777  222555 
456  jkl@email.com   
456333-333-333 mno@email.com   
789444-444-444555-555-555prs@email.com999  
789 666-666-666tuv@email.com999  
789  wxy@email.com999  
789  zzz@email.com999  

 

Looking forward to hearing your feedback, thanks.

2 REPLIES 2
Deano478
12 - Quasar

@Marceli_Szadowiak Can you please explain what you have tried to do in order to solve this problem so far that way we can go from there?

jrlindem
12 - Quasar

@Marceli_Szadowiak it also appears there's some logic missing.  Take Customer No. 789, for example, how would you know when the 666-666-6666 should drop down to the second entry?  It appears that since there is a third phone number it's being appended onto the second email address...

 

Ultimately, after having played around with this for a while, it appears there's some missing information that would be necessary to join up or merge all the data as you've arranged it in your example output.  Can you please clarify or attach what you've done so far as @Deano478 has suggested?

 

Cheers,  -Jay

Labels
Top Solution Authors