Alteryx Designer Desktop Discussions

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

create columns based on rows (kind of cross Tab)

mauricio
8 - Asteroid

Hi,

I'm trying to transform a table, to create some features (new columns) for a statistic model.

 

 

My initial dataset is like this:

Yeardif_yearuser_namefield1field30
20220bobaaammm
20220billbbbnnn
20220willcccooo
20211bobdddppp
20211billeeeqqq
20211willfffrrr
20202bobgggsss
20202billhhhttt
20202williiiuuu
20193bobjjjvvv
20193billkkkxxx
20193willlllzzz
,,,

 

 

And I wish to transform it into a dataset like this:

user_namefield1_diif_year_0…_diif_year_0field30_diif_year_0field1_diif_year_1…_diif_year_1field30_diif_year_1field1_diif_year_2…_diif_year_2field30_diif_year_2field1_diif_year_3…_diif_year_3field30_diif_year_3
bobaaammmdddpppgggsssjjjvvv
billbbbnnneeeqqqhhhtttkkkxxx
willcccooofffrrriiiuuulllzzz

 

The main challenge is the amount of fields (30+)

 

Any Help would be very much appreciate.

Best Regards!

 

 

 

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@mauricio 
I hope I understand your logic correctly.

0427-mauricio.PNG

flying008
14 - Magnetar

Hi,@mauricio 

 

please see the flow, if you don't need row order, then ignore the contain flow: 

 

录制_2022_04_27_15_19_18_553.gif

 

@Qiu , you are master !  I suppose him want retain columns order to output, then added some step.

mauricio
8 - Asteroid

Thank you @Qiu and @flying008 

That was exactly what I needed!

 

 

Qiu
21 - Polaris
21 - Polaris

@mauricio 
Thank you for the feedback and glad to be any help.

@flying008 
Your flow is indeed better with the consideration of sequence.

Thank you.

Labels