This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Hi
I am trying to build out the logic for dealing with the allocation of stock against orders, but can't quite work out the logic for this.
As an example I've got the following order data:
And this is my stock data:
The logic is stock items are allocated to an order based on the order received, for example order 1 will be fulfilled first and order 2 second, however items will only be allocated if the entire order can be completed.
For example, order one won't be completed as item C can not be fulfilled, therefore the stock for Items A and B are not allocated and roll down to later orders.
The resulting output should be:
I'm thinking it should be a batch macro, but I'm not too familiar with this so any help is greatly appreciated.
Akos
Hi @sahinakos,
There's no need for a macro here, please see the below.
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
HI @sahinakos,
I've built an iterative macro for your use case. Please let me know if you have any questions or issues.
Thanks,
Josh
Hi Akos
This is how I would build it. It's better to do this as an iterative macro as you can then join the stock data only to the 1st, 2nd, 3rd order etc and then loop through until you've dealt with every order.
I do this in several steps:
1) Join the stock data to the order data and fill in the L and R outputs for the join
2) Compare the number of items allocated to the order and if there's a match then reduce the stock, otherwise don't allocate anything
3) Create the output for the allocated/non-allocated items and create the stock output for the next iteration
Then by looking at the output you can see how many left over items you have.
@Jonathan-Sherman I like the non-iterative approach, my brain just defaults to iterative!
@Jonathan-Sherman looks like your answer is wrong. Order #3 is partially complete. They were to be fulfilled in full only.
Hi
I am solving the same fulfillement problem. I'm trying to understand your workflow but I stopped at scenario geenration. Is there a page that explains how this tool works and why it has created 15 scenarios in this example? and overall, why do we need to create scenarios?
Sorry, I am a beginner. Have never worked with this tool.
Any insight would be appreciated
Thanks