Alteryx Designer Desktop Discussions

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

Transform data from long to wide by applying top rows to each below

overhead_press
8 - Asteroid

I have the sample dataset below and the Name column contains the name and the employee number. Each time there is a name the numbers below it corresponds to the same person until a new name appears, so 123 pertains to BOB, 567 pertains to Rachel. 

 

What I am having issues figuring out is how to apply the row with the name in it to all the rows below it for the same employee as shown in the desired result, the column names do not matter. 

 

Thanks in advance! 

 

Sample data:

NameDatePAYTYPERATE
BOB08/04/211111STANDARD11.1
12307/06/212222A22.2
12307/06/212222B22.2
RACHEL15/04/213333STANDARD33.3
56722/04/214444C44.4
56722/04/214444D44.4
56722/04/214444E44.4
SMITH07/05/215555STANDARD55.5
88906/05/216666A66.6

 

Desired results:

NameDatePAYTYPERATEABCDE
12307/06/212222A22.2BOB08/04/211111STANDARD11.1
12307/06/212222B22.2BOB08/04/211111STANDARD11.1
56722/04/214444C44.4RACHEL15/04/213333STANDARD33.3
56722/04/214444D44.4RACHEL15/04/213333STANDARD33.3
56722/04/214444E44.4RACHEL15/04/213333STANDARD33.3
88906/05/216666A66.6SMITH07/05/215555STANDARD55.5
4 REPLIES 4
rfoster7
9 - Comet

a multirow tool will work. Question. Is type reliably "standard" on a name row? Because that would be easier to use than the Name for determining when to transition to a new group. 

 

rfoster7_0-1653675546914.png

 

This workflow uses a different multi row tool for each attribute column you want to roll down. However, you could use a single multi row tool to build a "row number" for each data group, then use some kind of cross tab/transpose magic to do it if you have more than the five columns you want to roll down or you want it to be more dynamic. 

 

 

Edit: Added a Multi Row example v2 that does it dynamically, by using a single multi row tool to create a "groupid" then splitting the standard rows off and joining them to the sub group rows. 

binuacs
20 - Arcturus

@overhead_press one way of doing this

 

binuacs_0-1653685051586.png

 

overhead_press
8 - Asteroid

Yes standard is on name row. 

 

Thank you another question I have what if I don't want values to repeat and only appear once? See column E:

 

Desired results:

NameDatePAYTYPERATEABCDE
12307/06/212222A22.2BOB08/04/211111STANDARD11.1
12307/06/212222B22.2BOB08/04/211111STANDARD 
56722/04/214444C44.4RACHEL15/04/213333STANDARD33.3
56722/04/214444D44.4RACHEL15/04/213333STANDARD 
56722/04/214444E44.4RACHEL15/04/213333STANDARD 
88906/05/216666A66.6SMITH07/05/215555STANDARD55.5
binuacs
20 - Arcturus

@overhead_press A multirow tool can do the trick

 

binuacs_0-1653686130084.png

 

Labels