Learn more about the Alteryx Maveryx Universe recently announced at Inspire 2023!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Order fulfilment problem

sahinakos
8 - Asteroid

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:

 

sahinakos_0-1572601489908.png

 

And this is my stock data:

 

sahinakos_1-1572601515224.png

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:

sahinakos_2-1572601551998.png

 

I'm thinking it should be a batch macro, but I'm not too familiar with this so any help is greatly appreciated.

 

Akos

7 REPLIES 7
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @sahinakos,

 

There's no need for a macro here, please see the below.

 

image.png

 

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

 

 

JoshuaGostick
11 - Bolide

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

cgoodman3
13 - Pulsar
13 - Pulsar

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

 

Capture3.PNG

 

Then by looking at the output you can see how many left over items you have.

 

Capture4.PNG

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
cgoodman3
13 - Pulsar
13 - Pulsar

@Jonathan-Sherman I like the non-iterative approach, my brain just defaults to iterative!

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
PaulRB
8 - Asteroid

@Jonathan-Sherman looks like your answer is wrong. Order #3 is partially complete. They were to be fulfilled in full only.

PaulRB
8 - Asteroid

Hi Akos, here's my attempt. 

image.png

image.png

This should have been a "weekly challenge". Actually, I seem to remember there was one similar to this.

HeliaS
6 - Meteoroid

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 

Labels