Decrementing a Value?

JoeGKushner

New member
Local time
Today, 16:26
Joined
Jun 23, 2015
Messages
9
We allocate products to orders. When we do this, it reserves the inventory. We also receive inventory throughout the day so the opportunity to increase fill rate increases as the day goes on.

To handle that, we have a report that shows the order, product, and the inventory.

However, we also get small increments of inventory due to returns. So if the product is on one hundred orders and we get 1 piece in, the report shows 1 piece available for one hundred orders.

I'd like to do something that decrements the available inventory per row based on the required quantity - the available quantity. I can use criteria >0 to filter out the remaining lines that would effectively have no inventory to allocate for.

I've looked online but haven't quite seen what I'm looking for. I suspect it's going to involve setting some variables and reseting the variables until the 'decrements' field is 0?


ORDER_ID PRODUCT_ID REQ AVL TEST
B X 2 10 10
F X 2 10 8
G X 2 10 6
J X 2 10 4
A X 1 10 3
C X 1 10 2
D X 1 10 1
E X 1 10
H X 1 10
I X 1 10
 
Sounds like a running sum and would be done in the query that the report is based on.

Search this forum for that term: "Running Sum Query"

Its been solved many times.
 
Many developers will use transactions to monitor inventory.
Anything sold/used is a - (minus/negative) transaction.
Anything received/returned is +(positive) transaction.

InventoryCurrentBalance = StartingValue +Received -Sold
 

Users who are viewing this thread

Back
Top Bottom