hi guys,
I have 2 tables:
1 with the max allocation:
1 with required from each customer, and date:
I want to allocate the Allocation according to the date FIFO of each customer. Result table looks like:
In excel, the approach is to sort the customer, date, then use the running total for each customer, and then compare with the allocation quantity.
What is the approach in Power Query to resolve this one? We can mimic the Excel approach with recursive function in Power Query, but it seems very ugly.
Thanks
I have 2 tables:
1 with the max allocation:
Customer | Allocation |
A | 8 |
B | 7 |
C | 5 |
1 with required from each customer, and date:
Customer | Date | Required |
A | 07-08-16 | 4 |
A | 08-08-16 | 5 |
B | 09-08-16 | 6 |
C | 10-08-16 | 7 |
A | 11-08-16 | 8 |
B | 12-08-16 | 9 |
I want to allocate the Allocation according to the date FIFO of each customer. Result table looks like:
Customer | Date | Required | Allocated |
A | 07-08-16 | 4 | 4 |
A | 08-08-16 | 5 | 4 |
B | 09-08-16 | 6 | 6 |
C | 10-08-16 | 7 | 5 |
A | 11-08-16 | 8 | 0 |
B | 12-08-16 | 9 | 0 |
In excel, the approach is to sort the customer, date, then use the running total for each customer, and then compare with the allocation quantity.
What is the approach in Power Query to resolve this one? We can mimic the Excel approach with recursive function in Power Query, but it seems very ugly.
Thanks
Attachments
Last edited: