Offset Function in Knime

Hi Guys,

This is my second post in as many days so hopefully you guys can help me out again.

I am currently running a comparision between knime and another similar product that is currently being used in our business. One of the functions that is used often is something called an "Offset" I am wondering how to use this same functionality in knime. I have copy and pasted below a description of how the "Offset" works from the other promgrams help file:

Retrieves values for a given field in the previous or following records. It returns the value of the field named FIELD in the record offset from the current record by the value of EXPR. If EXPR is a (literal) integer, it may be positive or negative; a positive offset refers to a record that has already passed, while a negative one specifies a "lookahead" to a record that has yet to arrive. For example, @OFFSET(Status, 1) returns the value of the Status field in the previous record, while @OFFSET(Status, –4) "looks ahead" four records in the sequence (that is, to records that have not yet passed through this node) to obtain the value.


An example of some of the offset code that has been used in the past is below:


then 'Yes'
else 'No'

What this code does is look at the SW_LT_GR_ID and checks to see if it equals the  SW_LT_GR_ID in the row above (IE the previous row). It then goes on to check that the CLIENT_ID and the CLIENT_ID_Min  fields do not match. The code will then place a "Yes" or "No" depending on whether or not the condition is met.

If knime is able to perform the same function with minimal fuss I would love to know. I would hope to be able to do this without the use of the java snippets if possible.


I don't know of any node that can do this. Almost all nodes only work with one row at a time or are for a very special purpose. Also tables in KNIME do not offer random access so getting the values of previous or following rows requires a substantial amount of bookeeping.

What we might be able to do is to tweak the Rule Engine node so that it is able to do such offset lookups. However, I have to look how much the implementation needs to be changed since again this node only looks at the current row.

This would be a powerful feature if implemented, both to the Rule Engine node and Maths Formula node. If this became possible in these two nodes, it would significantly improve some of KNIMEs capabilities I feel.

A workround of passing values to subsequent rows can be done using the Delegating Loop Start and End nodes, but its quite a complex setup to do.