3 Replies Latest reply: Jul 8, 2016 6:43 AM by Iskander Smagulov

# Product movement from one stock to another

Hi guys!

I have very important issue, please give an advice how to solve.

For example, I have 5 stocks. And some products in it. This is my table:

ProductShop1Shop2Shop3Shop4Shop5Stock1
SalesItem1543201
Remainder030111

Now I see that Shop1 has 0 of product Item1 but the shop made best sales.

So, I have to take product from Stock1 (first of all - if there exist products) and put it to Shop1.

Then I see that Shop2 has >0 remained products, so I skip it.

Then I see Shop3 has 0 of product. Now I will take it from Shop5, because it had 0 sales.

Finally I must have this table:

ProductShop1Shop2Shop3Shop4Shop5Stock1
SalesItem1543201
Remainder030111
Distributed131100

How to make it?

• ###### Re: Product movement from one stock to another

Hi

I tried with PIVOT table .

• ###### Re: Product movement from one stock to another

Thank you Allu!

Good example. But actually we have such steps:

1) Sort by sales.

2) Search for 0 values in shops

3) If some shop has 0 remained items and sales >0, then take firstly from stock (if there exist anything), if there is nothing take from such shop that has >1 items remained

4) If there are very few items remained, so we could not fulfill every shop, then fulfill the best saled shops

• ###### Re: Product movement from one stock to another

May be somebody could give some hint how to make this steps?

1) Sort by sales.

2) Search for 0 values remained in shops

3) If some shop has 0 remained items and sales >0, then take firstly from stock (if there exist anything), if there is nothing, take from such shop that has >1 items remained

4) If there are very few items remained, so we could not fulfill every shop, then fulfill the best selling shops