I'm working on a workflow to allocate product that is expiring to requirements that are on specific days. I've attached a spreadsheet of how the logic works. Each week you have a new allocation you need to serve, and a few batches of product with associated unusable dates. You can see in the Excel example, the Allocation quantity of 50 is served in full by the first batch, leaving the other two batches in a bucket of unusable. The second week, there's not enough product, so there's leftover allocation to be noted. I've attached a workflow with dummy data of how far we've gotten. We can make the logic work for the first line, but we're struggling to make it work for the subsequent lines. Also, this needs to be scaled up to many product/locations/timeframes, but only allocated for matching product/locations, taking into account the time frames. Any ideas?