Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Generate Missing Rows

twentytu
5 - Atom

Hi Alteryx Pros,

 

I know there are many topics about generating missing rows, but my case is a little different. 

I need help convert Left table to Right table. 

As you can see here, each ID might have multiple TYPE and VALUE. Every time when there is a TYPE, there must be a VALUE following. Please help, thanks in advance. 

 

LEFT   RIGHT  
IDCategoryRecordID IDCategoryRecordID
101TYPE3 101TYPE3
101TYPE3 101VALUE4
101VALUE4 101TYPE3
102TYPE3 101VALUE4
102TYPE3 102TYPE3
102VALUE4 102VALUE4
103TYPE3 102TYPE3
103TYPE3 102VALUE4
103VALUE4 103TYPE3
103TYPE3 103VALUE4
103VALUE4 103TYPE3
104TYPE3 103VALUE4
104TYPE3 103TYPE3
104VALUE4 103VALUE4
    104TYPE3
    104VALUE4
    104TYPE3
    104VALUE4
2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @twentytu 

 

Here is how you can do it.

 

Workflow:

atcodedog05_0-1626244370976.png

1. Using multirow formula tool to check whether Value row needs to be generated for Type and flag the Type row.

2. Using generate rows tool generating extra row for the flagged Type rows.

3. Using formula tool to replace the values in category and record ID for the newly generated Value row.

4. Using select tool to keep only the required records.

 

Hope this helps : )

 

Elias_Nordlinder
11 - Bolide

Hello,

I am not the OP but I just want to say that I really like the solution and how "Easy" it looks

to solve a problem like the one above with Alteryx and just the preparation tools.

 

Great use case of Generate Rows and Multi-Field Formula, I feel like I

utilize these tools too little and have to incorporate more in my flows at work.

 

They are great tools in use cases like this one 🙂

 

//Elias

Labels