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

Text to rows with multiple instances

aka_ash
8 - Asteroid

Hi,

Looking for some guidance on how I can split 2 columns and expand it to a 1 to 1 output.

Below is an input of sample data and a desired output

 

My data will also have data that may have spilled to the next row also and need it to be populated data from the cell above it.

I have highlighted these in orange the desired result for those.

 

Any assistance would be appreciated,

thanks in advance,

Ash

 

Input

Record IDItemsData 2
1AApple, Orange, CarrotLeft_A, Left_B, Right_C, Forward_A
  Forward_B, Back_D
1BOrangeLeft_B,Forward_C
1CBerry, Carrot, WatermelonLeft_B, Right_C, Forward_B

 

Output

Record IDItemsData 2
1AAppleLeft_A
1AAppleLeft_B
1AAppleRight_C
1AAppleForward_A
1AAppleForward_B
1AAppleBack_D
1AOrangeLeft_A
1AOrangeLeft_B
1AOrangeRight_C
1AOrangeForward_A
1AOrangeForward_B
1AOrangeBack_D
1ACarrotLeft_A
1ACarrotLeft_B
1ACarrotRight_C
1ACarrotForward_A
1ACarrotForward_B
1ACarrotBack_D
1BOrangeLeft_B
1BOrangeForward_C
1CBerryLeft_B
1CBerryRight_C
1CBerryForward_B
1CCarrotLeft_B
1CCarrotRight_C
1CCarrotForward_B
1CWatermelonLeft_B
1CWatermelonRight_C
1CWatermelonForward_B
11 REPLIES 11
Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @aka_ash ,

 

Here is how you can do it !Capture d’écran 2021-08-16 à 10.52.02.png

 

Basically, it adds the RecordID for missing values based on previous value. Then it concatenates all rows for each record ID and it splits both Items and last column to create combinations !

 

Let me know if you have any question !

atcodedog05
22 - Nova
22 - Nova

Hi @aka_ash 

 

Here is my take on it.

 

Workflow:

atcodedog05_0-1629105390330.png

 

Hope this helps : )

messi007
15 - Aurora
15 - Aurora

@aka_ash,

 

Another way to do it 🙂

 

messi007_0-1629105250667.png

 

Attached the workflow.

 

Hope this helps !

Regards.

aka_ash
8 - Asteroid

Hi,

 

Thanks so much for your responses @Jean-Balteryx@atcodedog05 and @messi007.

 

@Jean-Balteryx your solution was great however looks like i need an additional Multi-row formula for the "Items".

The other 2 worked well.

Thanks again all! 

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @aka_ash 

Cheers and have a nice day!

Jean-Balteryx
16 - Nebula
16 - Nebula

I see where I got it wrong. Using a filter at the end works but my solution is way under the two others !

binay2448
11 - Bolide

Find my solution for same

aka_ash
8 - Asteroid

Hi,

Thanks for the responses, 
i realised that there was a scenario that i didn't capture in my sample data.

Regarding the data that has spilled over to the next, the data may be split inbetween the expected string.

This might also be over multiple rows, like the updated input below with the same expected output.

Is there a way to merge the extra cells to the cells above then perform the split to rows?

 

Record IDItemsData 2
1AApple, Orange, CarrotLeft_A, Left_B, Right_C, Forw
  ard_A, Forward
  _B, Back_D
1BOrangeLeft_B,Forward_C
1CBerry, Carrot, WatermelonLeft_B, Right_C, Forward_B

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @aka_ash 

 

I am using modified version of @Jean-Balteryx workflow for this. This works only for text spill overs

 

Workflow:

atcodedog05_0-1629180307295.png

 

Hope this helps : )

 

Labels