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 Nbr | Shipto Addr Nbr | Bill to Addr | Cust Name | City | Count |
0768S | 1 | 1 | ABC Company | Los Angeles | 4 |
0768S | 2 | 1 | ABC Company | San Diego | 4 |
0768S | 3 | 1 | ABC Company | San Jose | 4 |
0768S | 4 | 0 | ABC 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 Nbr | Shipto Addr Nbr | Bill to Addr | Cust Name | City | New Cust Nbr | New Shipto Nbr |
0768S | 1 | 1 | ABC Company | Los Angeles | 101 | 1 |
0768S | 2 | 1 | ABC Company | San Diego | 101 | 2 |
0768S | 3 | 1 | ABC Company | San Jose | 101 | 3 |
0768S | 4 | ABC Company | 101 | 4 | ||
0768S | 2 | 1 | ABC Company | San Diego | 102 | 1 |
0768S | 1 | 1 | ABC Company | Los Angeles | 102 | 2 |
0768S | 3 | 1 | ABC Company | San Jose | 102 | 3 |
0768S | 4 | ABC Company | 102 | 4 | ||
0768S | 3 | 1 | ABC Company | San Jose | 103 | 1 |
0768S | 1 | 1 | ABC Company | Los Angeles | 103 | 2 |
0768S | 2 | 1 | ABC Company | San Diego | 103 | 3 |
0768S | 4 | ABC Company | 103 | 4 |
Has anyone did something similar? Or does someone have any ideas on how to due this?
Solved! Go to Solution.
Hi @gesh2112 !
I don't think an iterative macro is required. Please find attached.
Best,
Calvin