Subtract two rows consecutive in Knime

Hi guys,

I have this table, and I would like to know if it is possible to subtract the first two values ​​and place the result where the missing value is.

image

Short answer: yes, it is.
Maybe you have a look at the Lag Node.

But I assume you are looking for a report of this data. Such a task might be solved using the KNIME reporting capabilitìes.

1 Like

And what are those capabilities? At least I think I can solve it in the following way, but if there is another way, then please let me know.

I did the following:

Try this. The problem with using a Lag node is that there’s no easy way to get the number in the same column. I assume you want to subtract the second number from the first.

2 Likes

Thanks, friend, it worked for me

If you only have two values you might also get the result with moving aggregator and range calculation. Just for future reference.
Glad you solved it.
br

Glad that you’ve solved your primary challenge.

May I kindly draw you attention to this article New KNIME Reporting... say Hi! about the new reporting in KNIME.

1 Like

Out of curiosity why did you duplicate what I had already uploaded? If you had a different approach it would be helpful. This isn’t very useful.

1 Like

Hello @rfeigel

I tried your workflow locally and it worked for me, so I posted it here.

I will definitely explore another method and share that as well.

Could you please elaborate on why it isn’t useful?

Don’t repost someone else’s work. It adds no value to the Forum. The inquirer can simply download the original post. You’re complicating things and appear to be taking credit for someone else’s work. You could add a comment - “I tried it and it seems to address the issue.” , but a “like” is sufficient.

3 Likes

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