replace empty fields

I want to replace empty fields with a value in a column, filled fields should be preserved.
The problem is that empty fields are not recognized, only an empty field with “?” Is recognized. I found some hints in the forum, but they did not work.

Otherwise I do this via the node rule engine:
MISSING $company$ => “NEW”
TRUE => $company$

Does somebody has any idea?

2 Likes

You could use the toNull() function in the String Manipulation node to convert blanks to missing values, and then handle all missings at once with the Missing Value node.

6 Likes

Thank you very much.

Hi,

Beside the solution that @ScottF has provided for converting the empty (blank) cells to missing, I can suggest using “Column Auto Type Cast” node in which you can do the trick for several columns at once by setting the “Missing value pattern” option to <empty>. (Thanks to @Iris for teaching this to me at replace empty cell with missing (?) globally in table)

Best,
Armin

2 Likes

Hi Armin,

this is great, and thank you for sharing the other chat too. It´s very helpful for me.
I wonder why I did not find this chat yesterday in my search in the forum. I’ve read and tried so much, but not the simple one.

Thanks,
Nicole

If you ever need to do things the other way round and assign missing values, @ipazin had an idea for that too:

2 Likes

Have you tried the following rule:
$company$ = "" => "NEW"

1 Like

I could remember this topic, but usually I use the bot I’ve built for KNIME forum (https://github.com/armingrudd/KNIME-forum-Selena-bot) to find similar topics.
I hope I would be allowed to run it in forum soon. The bot (which I call it @Selena now) automatically finds similar topics and suggests them to users.

1 Like