Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Creating repeating columns from a normalised DB

alexrossiter
6 - Meteoroid

Hi - I have a dataset with the following structure:

 

ID NUMBERMODULEMARKEXAM DATE
123ABC70%10/01/2020
123DEF80%11/01/2020
124GHI50%13/01/2020
124JKL55%12/01/2020

 

But need it to look like this for a statutory return:

 

ID NUMBERMODULEMARKEXAM DATEMODULEMARKEXAM DATE
123ABC70%10/01/2020DEF80%11/01/2020
124GHI50%13/01/2020JKL55%

12/01/2020

 

Does anyone have any ideas how to achieve this as I've not been able to find any comparable examples in the community.

 

Many thanks,

 

Alex 

6 REPLIES 6
Emil_Kos
17 - Castor
17 - Castor

Hi @alexrossiter,


I have crerated a workflow for you:

 

Emil_Kos_0-1611074529450.png

The only downside is that I needed to cheat a little bit as you can't have the same column name twice in the data. So one of the columns is called "Mark" and the second one is "Mark " etc.

 

Emil_Kos_1-1611074573279.png

I hope it will work for you!

 

alexrossiter
6 - Meteoroid

Thanks Emil - that works great when a student has two modules. Have you any idea how it could be extended if they are doing more - ideally so the columns continue to repeat until all modules for that ID  have been placed on the same line.

 

Thanks,

 

Alex

Emil_Kos
17 - Castor
17 - Castor

Hi @alexrossiter,

 

Do you know what is the max iteration? 

 

Actually, I don't have an answer for this from top of my head.  

alexrossiter
6 - Meteoroid

Maximum should be 8.

 

Thanks,

 

Alex

Emil_Kos
17 - Castor
17 - Castor

Hi @alexrossiter,

 

Actually, I was able to finish this exercise. 

 

Emil_Kos_0-1611137959767.png

I learned something new with this one. Thanks for that 😄

 

If this works for you please mark it as a solution!

alexrossiter
6 - Meteoroid

Brilliant Thanks, Alex.

Labels