How to write in a table with some conditions

Hi all,
I have a table like this:

image

And I want to write in this table the relative Name for each ID in all rows. So for example I should obtain this:

image

How can I do that?
Thanks
Giad

Hello @giad,

if those question marks represent missing values in KNIME (missing values in KNIME are denoted as red questions marks) then Missing Value node with Previous Value option should do the trick :wink:
(This will work under assumption that each ID group at first has name value.)

Br,
Ivan

5 Likes

Thanks Ipazin, I forgot to tell you one important thing:

I do not have the name for all ID. The name is present only if the event = enroll. If there is no the event enroll, I do not have the name. And I cannot use what you say otherwise I associate previous value also to ID that should be empty because they do not have event = enroll…

Can you understand me? I think I need a rule previously on the event= enroll maybe…
Thanks
Giad

hi @giad,

@ipazin 's approach was a perfect solution for your shown example.
For the more complex case of not having an “ENROLL”-row as the first one for an ID, you have to

  • filter the data for “ENROLL”-values
  • group by ID
  • append the Name for each group to the dataset
  • define a rule to overwrite the Name in first place

please find a workflow attached.
That should also be useable in case the ENROLL-value is not the first one in the order of values for an ID.
replace Name by Group Value.knwf (14.1 KB)

hope that helps, regards, Tommy

2 Likes

Great it works!
Many thanks
Giad

1 Like

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