repeat the months in a column!!!!

Hi knime

I am starting to use knime, my problem is: I need to repeat the months in the column until I get to the next month and so repeat again. Cells with “?”

X Y Z MES
1 3 9 marzo
13 2 11 ?
2 3 1 ?
2 11 4 ?
2 2 2 abril
1 23 2 ?
2 3 5 ?
23 1 2 ?
2 5 6 mayo
1 1 1 ?
2 2 2 ?
w 1 e ?

Hi @fernando1987

There are probably several ways to do this. I tried a very quick and very dirty Java Snippet node and it seemed to produce the desired result.

It looks for a value in the MES cell for that row, and if it finds something, then it creates a new row called Month and enters that value, while also saving that value as a variable called prev_month. If there is no value in the MES cell, then it fills in the Month cell with the prev_month variable that was previously stored.

image

1 Like

Hi,

Use the “Missing value” node. In the Column setting tab select your MES column and set “Previous value”

6 Likes

Thank you so much !! helped me to solve my problem

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