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

Iterative Macro Adding lines based on group by

gesh2112
7 - Meteor

Hello,

 

I am trying to export data from one database and merge and change it to add it to another database.  However, merging the customers is fairly easy using Alteryx but the latest batch of data and its rules are confusing and I am not sure exactly how to do this in Alteryx.  I am thinking I need to create an Alteryx Iterative Macro to get the job done.

 

Data I am pulling is the following:

Old Cust NbrShipto Addr NbrBill to AddrCust NameCityCount
0768S11ABC CompanyLos Angeles 4
0768S21ABC CompanySan Diego4
0768S31ABC CompanySan Jose4
0768S40ABC Company 4

 

The rule is for every customer number with a Bill to Addr flag of 1 then make it a new bill to address but add all address as ship to address.

 

So here is what the data should come out as:

 

Old Cust NbrShipto Addr NbrBill to AddrCust NameCityNew Cust NbrNew Shipto Nbr
0768S11ABC CompanyLos Angeles 1011
0768S21ABC CompanySan Diego1012
0768S31ABC CompanySan Jose1013
0768S4 ABC Company 1014
0768S21ABC CompanySan Diego1021
0768S11ABC CompanyLos Angeles 1022
0768S31ABC CompanySan Jose1023
0768S4 ABC Company 1024
0768S31ABC CompanySan Jose1031
0768S11ABC CompanyLos Angeles 1032
0768S21ABC CompanySan Diego1033
0768S4 ABC Company 1034

 

Has anyone did something similar?  Or does someone have any ideas on how to due this?

1 REPLY 1
caltang
17 - Castor
17 - Castor

Hi @gesh2112 !

 

I don't think an iterative macro is required. Please find attached.

 

 

Best,

Calvin

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels