Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Transpose data dynamically

Analytics_Pooja
8 - Asteroid

I current have data in this format. 

 

Collection NameOwner IDDateAdded byUser 1Can AddCan RemoveUser 2Can Add2Can Remove2
test1hf4387230hfSept 04, 2021Admin 1TomFalseFalseHarryTrueTrue
test2ewdj8934e32Sept 07, 2021Admin 2JerryTrueTruePerryTrueTrue

 

After transpose the desired output is:

 

Collection NameOwner IDDateAdded byUser Can AddCan Remove
test1hf4387230hfSept 04, 2021Admin 1TomFalseFalse
test1hf4387230hfSept 04, 2021Admin 1HarryTrueTrue
test2ewdj8934e32Sept 07, 2021Admin 2JerryTrueTrue
test2ewdj8934e32Sept 07, 2021Admin 2PerryTrueTrue

 

The purpose is to transpose  User, Can Add and Can Remove column to get single column for each. 

 

User, "Can add" and "Can Remove"  - number of columns will increase dynamically. Example, there could be user 4 or user 5 as well for certain collections. 

 

Any help would be much appreciated. 

 

Best

Pooja 

3 REPLIES 3
mst3k
11 - Bolide

you can do it with a transpose and a crosstab. the trick is the tile tool to give a key to "pivot" it around. the regex tool strips the "2", "3", "4" etc from your fields names, that could cause problems if any of the fields should keep a number in it...

 

this works fine if you add more users, as you can see here i added a "Zach" to admin 1 and it runs fine.

mst3k_0-1632199905516.png

 

BrandonB
Alteryx
Alteryx

Nice solution @mst3k!

 

I took a slightly different approach with the same result

 

 

BrandonB_0-1632200136900.png

 

Analytics_Pooja
8 - Asteroid

This works perfectly! Thank you

Labels