# Filter/compare value of current row with the next row.

Hi,

I have a need to create a filter similar to the one in IBM SPSS. In IBM SPSS there is a function @offset. It compares the current value with the value in the next row or previous row.

More details about @offset are at the following link.

http://tech.oscarvalles.com/2010/11/using-offset-in-spss-clementine/

Is it possible to create a similar function in RapidMiner.

Basically what I want to do is:

If (value of column x of current row = to value of column x or y of a differnt row)

then (calculation etc).

Thanks

I have a need to create a filter similar to the one in IBM SPSS. In IBM SPSS there is a function @offset. It compares the current value with the value in the next row or previous row.

More details about @offset are at the following link.

http://tech.oscarvalles.com/2010/11/using-offset-in-spss-clementine/

Is it possible to create a similar function in RapidMiner.

Basically what I want to do is:

If (value of column x of current row = to value of column x or y of a differnt row)

then (calculation etc).

Thanks

Tagged:

0

## Answers

7Contributor II1,869Unicornthe Lag operator is indeed what I would suggest. Btw, if you compare the columns the other way round you have the negative shifts, or did I get something wrong?

Furthermore maybe the Differentiate operator may be of interest.

If you combine any of them with Generate Attributes you are quite flexible.

Best regards,

Marius

7Contributor III don't realy understand how you mean to compare the other way around: Let us say you have the following Data:

Date Date-1 (lag1)

Timestamp1 -

Timestamp2 Timestamp1

Timestamp3 Timestamp2

Timestamp4 Timestamp3

Timestamp4

With the lag opererator I can only compare Timestamp 1&2 at line 2 and not Timestamp 1&2 at line 1. Therefore I can compare with the past value but not with the next, (especially if one likes to use the "Generate Attribute" Operator in order to generate a new value based on the calculations). I solve this problem right now with LOOP, Extract Macro and Set Data Operator. Any other tipps? The Differentiate operator seems also only allow positive shifts.

1,869UnicornBest regards,

Marius