I want Column B to start with the sum of all values in Column A, so 26 in this case. Then I want the second cell of Column B (B2) to say 21 (26-5). Third cell of Column B (b3) to say 14 (21-7). And so forth.
There are probably a bunch of ways to do this, but you could use a âcounter generationâ node to add a column with the numerical order and then sort it in reverse order, then do a running total, then sort it back.
This is very helpful, thanks. Last question, how do I get the sum of the Column A to be a new entry at the bottom of Column A first, and then do everything you did in terms of moving it to the top row and then subtracting as you did?
I would caution against manually entering the row numbers in order to get a 1 node solution unless this is for some single use workflow that will be deleted after use.
As a general rule I believe that everything in KNIME should be focused on a dynamic approach to avoid future problems. That being said, I think @gonhaddockâs approach is certainly cleaner if you control the row numbers via a row count and flow variable so that it dynamically adapts to updated data with variable number of rows. I can throw it into the workflow as well if you are not familiar with flow variable use yet.