Count number of months that inventory levels covers

Hello everybody,
I have been stuck in developing a model that counts the number of month necessary to consume inventory based on the sales forcasts, it converts the inventory levels from units to coverage in months with the following logic:
I have the stock levels projections and the sales forecast (quantities to be consumed) for each month. The model needs to keep substracting the monthly sales forecasts out of the inventory level and return the number of months needed for it to be fully consumed.
Attached is an excel file that explain the desired output.
Sales.xlsx (10.5 KB)

hi @mehdi_zinbi ,
with a short python script I have already solved the problem, but you did not give me any feedback when I proposed one last time, so I guess you are only interested in answers based on Knime nodes

Thank you for getting back to me. For the previous topic I have used your solution with python and it works perfect, thank you somuch for that. However, this is a different problematic with a different logic and even different inputs. So I don’t think the previous solution would work for this specific case.

@mehdi_zinbi ok, I take it as a challenge :smile:
inventory.knwf (7.9 KB)

I’ve changed the last sales value 20 => 30, just to test what happens when inventory < sales


Hi @mehdi_zinbi it’s always a good practice to provide feedback on previous solutions. And thank them. Otherwise you can’t expect people will be encouraged to continue assisting you on the platform.


Hello @duristef, It works perfectly. Thank you so much for all your help, I really appreciate it.


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