How to discount in the same column?

Hi guys!
I’m new at Knime and I am trying to perform a subtraction in order to consume my available stock.
image

In this scenario, I have multiple clients that want the same SKU, but I can’t fulfill all the requests. For example, the client X wants 5 pieces of SKU A, and since I have 20 pieces available, I can fulfill his request and still remain more 15 pieces. My second client, Y, wants 15 pieces from the same SKU, and I can fulfill his request, remaining zero pieces.
Since I have another client (client Z) that wants more 2 pieces, I will not be able to deliver his request, because I do not have a single piece left.

I don’t know how to do this math in knime. Can anyone help me please?

Hi @GOLTLC and welcome to the Knime Community.

I think this thread is a bit similar to what you are looking for:

Please check it out, there are sample code from the Community in the thread that addresses what the user was looking for, which looks similar to what you are looking for.

If this does not work, please let us know, and we will try to come up with something new.

3 Likes

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