Find the first shortage that has to be ordered in stock movement table


Hi All ,

I am trying solution to find the where i have to find the first Customer Order for which i have placed no orders to cover the demand , for each product, above screenshot is of list of all customer orders i have received for pants and shirts and it also has the Order if any that i have placed to a distributor , & the current stock i hold in hand the running total have been calculated in the last column already , this table is arranged by the date required , i have to reduce this table to first row where the shortage starts for each product, please let if this can be solved in R , thanks in advance for any suggestions or help.
The first part is to remove the -46 value in running stock column for pants , since after that demand their is incoming stock hence this -ve value should not be considered.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.