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

Alteryx Designer Desktop Discussions

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

Duplicate Records based on a grouping (Join)

ABCDA
7 - Meteor

Was hoping someone could help me with the following:

I have 2 tables:

 

One called customer that contains the following fields:

CompareIDPrimary
110
120
210
240

 

A second table called item

ItemPrimaryStatus
12345610Y
23456720Y
01234540Y

 

What I want to do is Join the 2 tables by the Primary Field  for each CompareID and duplicate the records based on the ComapreID, Item, and Primary.  

Results I'm trying to achieve:  The First Line with CompareID = 1, Primary =10, Item = 123456, Status = Y comes in with the join.  The second is what I need to duplicate.  Since CompareID = 1 consists of primary 10 and 20 I need to create the record of CompareID =1, Primary =20, Item = 123456, Status = Y.    I've tried the Append tool which gets me part of the way but I can not find a way to only duplicate the line for only the grouped CompareId.  Thannks in advance for any help.

Results   
CompareIDPrimaryItemStatus
110123456Y
120123456Y
120234567Y
110234567Y
210123456Y
210012345Y
240012345Y
240123456Y
2 REPLIES 2
binuacs
21 - Polaris

@ABCDA One way of doing this with the help of batch macro

image.png

ABCDA
7 - Meteor

Thank you!

Labels