CALCULATE ALL DIFFERENCES BETWEEN VALUES OF CONSECUTIVE COLUMNS

hello everyone.
I need a suggestion to do this operation:

I want to replace the value 1.96 with the result of the subtraction between 1.963-1.96 so the result must be 0.003.
Similarly, instead of 1.963, the result of the subtraction between 1.966-1.963 = 0.003 must be written.
basically I have to replace the values ​​of the column with the difference between the values ​​of the following column and the current column.
This operation must be performed in all the cells of the table containing values.

Welcome to the KNIME Community. Does your table expand dynamically or is it a fixed length, e.g. a 24 hour period? If you share some sample data it would be easier to find some help.

2 Likes

Table expand dynamically.
Sample data… thanks!
ESEMPIO.csv (94.9 KB)

Try this. If it works for you please mark solved. If not, please give details on the issues.

2 Likes

Thank you so much!
What you proposed solves almost all of my problem.
It would be useful to put some calculation conditions before performing the subtraction that verify that the two terms to be subtracted are not null (if they are 0 it is not a problem) and that the second term is greater than or equal to the previous one in order to avoid untrue negative values ​​(e.g. row 19 column 6 of the final table).
Your help was essential.
Thanks again.

1 Like

You describe two situations:

  1. Both terms = null
  2. Second term >= first term
    Exactly what do you want in both cases? What does a “null” look like in your data?

I tried modifying the expression and managed to solve the problem myself!
I modified the expression like this:


I am truly grateful for the help you gave me.
The problem is now solved!
Thank you!!!

2 Likes

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