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.

How to duplicate rows when a condition is met

WCH
7 - Meteor

Hi Guys, 

 

Thank you in advance for helping me with this.  I am trying to convert the existing table to the desire one

 

so the request is 1)product code AAA EF/GH is combined in one line, and I need to split them out

                            2) When Product Line = 111,  need to generate the same record for product AAA EF & AAA GH as well.

 

is there any simply workflow to do this?

 

Existing:

Product NameProduct CodeProduct Line
AAA CDAAA CD111
AAA CDAAA CD222
AAA ZZAAA EF/GH333
AAA ZZAAA EF/GH444

 

Desire:

Product NameProduct CodeProduct Line
AAA CDAAA CD111
AAA CDAAA CD222
AAA ZZAAA EF333
AAA ZZAAA EF444
AAA ZZAAA GH333
AAA ZZAAA GH444
AAA ZZAAA EF111
AAA ZZAAA GH111
3 REPLIES 3
kathleenmonks
Alteryx
Alteryx

Hi @WCH,

 

For your first problem, see my attached solution and screenshot. I first parse out the different product codes, then transpose the data and filter out null values. 

split_prod_code.PNG

 

As for your second problem, do you have another file you can join that would list the product lines that need to be duplicated for EF and GH?

binuacs
21 - Polaris

@WCH one way of doing this

binuacs_0-1660774569461.png

 

WCH
7 - Meteor

@binuacs I like this solution, very direct and simple. Just one quick question, in the setting of app Generate Rows, do I put whatever number of rows I want to generate, cuz actually it is a long file, I think maybe 2000 rows. now sure if the work flow would still works in that way. I need to test it out.

Labels
Top Solution Authors