I am using the java snippet (simple) node. I want to compare the current and just the previous row value. How do I do that?
Like if table is
When I am in row 2, I want to compare it with row 1, when in row 4, want to compare with row 3 and son on.
@sujitnath84 and welcome to KNIME Forum
Did you try the
Lag Column node?
Yes, tried that now. seems to work.
In Java, there’s no way to reference the previous node? As even if I create an array of the row, it will treat individual row of that column as one array element and it wont go ahead of a.
Seems, it works in a much different way than traditional java.
It’s possible, though rather crude. I suggest to have a look here:
I have a class of tricky data management problems where the current value of a cell does depend on the value of previous cells in the same column as well as on previous values of other columns.
I could do this with first using a “Lag Column” node and thereafter a combination of “Rule Engine”/“Math Formula” or I could pipe the whole thing to R do the transformation there and than pipe it back to Knime.
While the Knime solution might work it is not very flexible. The R solution on the other hand…
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.