Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Splitting on Multiple Rows + Concatenation

Shell
6 - Meteoroid

I hope some trick is out there somewhere to handle this puzzle.

I have a column that shows which possible groups a product may belong to. The product MAY NOT belong to any group at all - but if it does; groups start after '/' and can range from A-Z.

Current format of the values is: 

 

ProductGroup
A49-8547/A/B/C/...
X59-4857

 

What I need is to split this column into multiple rows so that the product code is repeated with the value of the group concatenated at the end. Note that NOT all products belong to all groups. 

 

ProductGroup
A49-8547A
A49-8547B
A49-8547C
....
A49-8547Z

 

My current (very poor) approaches:

  • split the column on multiple rows using / as a delimiter, but cant figure out how to concatenate the group values with related product rows. 
  • add "endswith()" filters in chronological order for testing each group (26 cascading layers). Then replacing() the remaining group names.

any help is appreciated

 

 

6 REPLIES 6
JosephSerpis
17 - Castor
17 - Castor

Hi @Shell I mocked up an approach let me know what you think?

bpatel
Alteryx Alumni (Retired)

hi @Shell ,

 

here is my approach. Hope this helps!

bpatel_0-1598546416482.png

 

Shell
6 - Meteoroid

Thank you @bpatel,

 

your approach is good and simple. however, it is not going to help me because you are "parsing a pattern" from the product. while indeed, this part of the value varies not only in pattern but also size. I appreciate your time.

Shell
6 - Meteoroid

@

 

your solution is: #simple, #effective #lovely #expandable and #logical. woks like a charm.

 

however, i discovered few additional patterns in my data. I'm trying to take a shot on them but would love to hear from you if you have a better idea.

 

here are few examples in the pattern:

ProductGroupComments
B34-4524/A/B/C/DYour solution works as expected.
B34-4524A/B/C/Dnotice the absent slash after number 4
B34-4524/4858/7736

In this case 4524 should be replaced by 4858 and 7736 on the following 2 rows. 

i.e.

B34-4524

B34-4858

B34-7736

 

appreciate your time. 

JosephSerpis
17 - Castor
17 - Castor

Hi @Shell I amended the workflow to account for those additional patterns.

grazitti_sapna
17 - Castor

HI @Shell , give this a try. I hope it works for you.

grazitti_sapna_0-1598854845271.png

 

Sapna Gupta
Labels
Top Solution Authors