I've hit a wall and would appreciate any pointers in moving forward on some code...
I have some data in the following format:
ID, QtyIN, QtyOUT
1, 30, 0
13, 0, 40
16, 50, 0
32, 0, 40
Basically showing stock movements for a part, purchases and sales.
What I am trying to get is for every QtyOUT the ID for each QtyIN that is required to fulfil the sale. The ID number is always in chronological order so the lower the number the sooner it is in (or out).
So in the case of the above data I would want something along the lines of:
ID, QtyOUT, IDtoFulfil
13, 40, 1 and 16
32, 40, 16
I have some data in the following format:
ID, QtyIN, QtyOUT
1, 30, 0
13, 0, 40
16, 50, 0
32, 0, 40
Basically showing stock movements for a part, purchases and sales.
What I am trying to get is for every QtyOUT the ID for each QtyIN that is required to fulfil the sale. The ID number is always in chronological order so the lower the number the sooner it is in (or out).
So in the case of the above data I would want something along the lines of:
ID, QtyOUT, IDtoFulfil
13, 40, 1 and 16
32, 40, 16
Comment