Combine columns if value is missing in one column

Hi Everyone,

I’m very new to KNIME, just started my first workflow and I need a little help.

In column A I have IDs, some of them missing. In column B if have different ID, some missing. I want to merge these columns, but only if there’s no value in column A.

Example:
ColA ColB Result
3546 ajsk 3546
lhsg lhsg
4769 4769

           hdzj      hdzj

7843 gdhj 7843

So I need ColA value if it’s present, ColB if it’s not present and blank if both are missing. I have some ideas, but I would prefer something more simple.

Thanks for your help!

I see the columns are messed up now, but maybe you will understand.

Hi @ph0703, have you tried the Column Merger node?

1 Like

I think you are right. I thought the replace column option would actually replace everything in the column. But it looks like it only replaced when ColA was empty. Thanks for the quick reply!

Hi there @ph0703,

welcome to KNIME Community!

As @elsamuel pointed out you need to use Column Merger with option Append new column. This node will give you missing values in case both columns have missing value. You can have blank instead missings by using Missing Value or Rule Engine nodes for example.

Hope this helps.

Br,
Ivan

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