Copy values from previous row to next row until a row has data.

Hello Team,

I wanted your help to copy the highlighted data in fig:1 to the fields in the below which are blank.

Fig :1 Data :
image (7)

Output :
image (9)

I tried lag column but the blanks following the data could be any number, it need not be always 2 or 3 blanks cells following it

Note: Date may or may not be same for each Online Customer, but Vch No. is always unique for each Online customer

Hi @Dheeraj_7716

Welcome to the KNIME forum!

A way to do this is with the Missing Value node. It allows the option to use the previous value for missing values. I used a simplified version of your example:

Within the Missing Value node, add Column1 and Column3 to the list under Column Settings and select Previous Value.

Final result:

image

Hope this helps!

6 Likes

Hi @ArjenEX,

Thanks for having me here. Yes it did help!

The node works perfectly. The problem I faced was due to fields having blank in them.
I replaced blank with null and then used the missing Missing Value node.

Thank you for your super quick response. Really appreciate it.

Good to hear! Please mark it as solution to help fellow knime’rs facing the same issue more efficiently :slight_smile:

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