loopHi,
I have a very specific problem in Alteryx.
I have two tables:
Table 1:
Cost_to_be_added
200
130
120
100
98
55
54
54
50
30
25
24
18
10
9
8
2
1
1
Table 2:
| Salesman | Cost |
| Bob | 30 |
| Robin | 35 |
| Ted | 36 |
| Lilly | 40 |
| Tracy | 45 |
Now I would like to add the costs of table 1 to the row in table 2 who has the lowest cost. So that the first entry of table 1 '200' will be added to Bob. So the table looks like this now:
Calculated Table (First iteration):
Table 2:
| Salesman | Cost |
| Bob | 230 |
| Robin | 35 |
| Ted | 36 |
| Lilly | 40 |
| Tracy | 45 |
After this addition, we check who now has the lowest cost. This will be Robin.So we take the next value from Table 1: '130' and add it to Robin's cost.
So now the table will be:
Calculated Table (Second iteration):
Table 2:
| Salesman | Cost |
| Bob | 230 |
| Robin | 165 |
| Ted | 36 |
| Lilly | 40 |
| Tracy | 45 |
Again we check for the person with the lowest cost and add the third value of table 1 to his/her cost. This process repeats until all the values of Table 1 has been added to Table 2.
This can be achieved simply using some programming language but as a part of my work, I've to implement this in Alteryx.
Any suggestions would be appreciated.