Free Trial

Alteryx Designer Desktop Discussions

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

please help transposing data

Jocelynupup
7 - Meteor

Hi everyone,

 

I have this dataset. I am thinking about using cross tab to do it, but don't know how.

Data:

customer IDcustomer nameproduct
1Afood
1Apet
1Atoy
1Abath
2Bcloth
3Cfood
3Ckitchen

 

I am trying to transpose to the following format:

result

customer IDcustomer nameproduct No1product No2product No3More?
1AfoodpettoyY
2Bcloth  N
3Cfoodkitchen N

 

Thank you for your help.

6 REPLIES 6
CoG
14 - Magnetar

Just to check and make sure, do you only want a maximum of three Products in columns, or do you need/prefer all the columns to be Cross Tabbed? Also, if you want to truncate your results to three columns, how do you pick which product(s) you want to drop/treat as extra (with 'Y' in [More?] column)?

Jocelynupup
7 - Meteor

Good questions, I didn't think about this.

1. Yes, I only want maximum of 3 name of products. Otherwise, it's going to be endless.

2. If there are more three products, then we only randomly return the name of three products and mark it as "Y" in last column called [More?]. Otherwise, if there are less or equal than 3, it's going to be marked as "N".

CoG
14 - Magnetar

When many people say random, they don't actually mean random (I don't know which you are so I built 2 options for you) ;). Using one of @Qiu 's favorite tools... The Tile Tool!!!

Screenshot.png

Qiu
21 - Polaris
21 - Polaris

@CoG 
Thank you for noticing my favorite tool and hope you like it.😁

Just read your flow and it is smart one, specially the filter "[Tile_SequenceNum] < 5".
I was wondering where is the "5" coming from 😂

Jocelynupup
7 - Meteor

The workflow works even if the filter tool is taken away. 😁

Jocelynupup
7 - Meteor

The workflow works for my dataset! Thank you very much. 

Labels
Top Solution Authors