rownum based get value other column

hi all

if it is null,

I want to get the fifth value of the other column.

using java snippet node or other node, not Lag node

please help me
20181109_094058

Hi @mois50,

do you always want to replace the missing value in attribute1 with the value from attribute2 five rows above? Why don’t you want to use the Lag node for this?

Best,
Marten

Sometimes I want to get the value 100 times before and after.
When you use LAG NODE, you have to make 100 additional columns.
so, I wanna know other solution using Knime.
thank you reply

No, you don’t have to create 100 additional columns to achieve this. Set Lag to 1 and Lag Interval to 100, so you’ll get one additional column with the information you want.

The most important question for me is: When and how do you decide which value should replace the missing value, e.g. the 5th or 100th value?

2 Likes

Hi there!

As Marten mentioned you should use Lag Column column for this. Otherwise it gets pretty complicated. To solve problem whether it is the 5th or 100th values use Integer Input node and then with flow variable control Lag Interval parameter in Lag Column node. After Lag node use Rule engine node and that’s it.

Br,
Ivan

2 Likes