Hi ,
I have following data set
Row | DEAL TYPE | CUSTOMER - ID | AMOUNT |
1 | 7 | 100A | 100 |
2 | CA | 100A | -100 |
3 | CA | 100A | 100 |
4 | 01 | 7059 | 96891.8 |
5 | 01 | 7059 | -96887.65 |
6 | 04 | 7059 | -851.5 |
7 | 04 | 7059 | -4.15 |
8 | 04 | 7059 | 4.15 |
9 | 77 | 7059 | 851.5 |
10 | 88 | 7059 | -4.15 |
11 | 99 | 200A | 200 |
12 | 39 | 200A | -200 |
13 | 39 | 200A | 200 |
14 | 99 | 200A | 200 |
15 | 99 | 400A | -200 |
16 | 39 | 400A | -200 |
Rules : for Expected output
1. Deal type should not be same and Amount should be "+" and "-" then it is Match
ex: row 1 and 2 deal type is different and amount 100 is positive and negative then it is Match
2. Based on customer id sum of different Amounts needs to be offset with remaining amount.
ex: from row 4 to 10 we have same customer id's 851.5 is offset with -851.5 with different deal type same for 4.15
for -96887.65 it will be sum of row 5 and row 7 within same id
Expected output:
Row | DEAL TYPE | CUSTOMER - ID | AMOUNT | |
1 | 7 | 100A | 100 | M |
2 | CA | 100A | -100 | M |
3 | CA | 100A | 100 | |
4 | 01 | 7059 | 96891.8 | M |
5 | 01 | 7059 | -96887.65 | M |
6 | 04 | 7059 | -851.5 | M |
7 | 04 | 7059 | -4.15 | M |
8 | 04 | 7059 | 4.15 | M |
9 | 77 | 7059 | 851.5 | M |
10 | 88 | 7059 | -4.15 | m |
11 | 99 | 200A | 200 | M |
12 | 39 | 200A | -200 | M |
13 | 39 | 200A | 200 | M |
14 | 99 | 200A | 200 | M |
15 | 99 | 400A | -200 | M |
16 | 39 | 400A | -200 | M |
Here are a few related posts. Hopefully these are not archived. The last one that mentions the Optimization tool may be a good place to start.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Supplier-optimisation/td-p/445171
One way this could be done is via the optimization tool
https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Reconciling-transactions-find-...
Chris