Replace Missing Values

Team -

Reading thru various forum posts and I’m still struggling with replacing missing values. I have a large table where values are missing and are represented as a ? (i.e. null) and I’m simply trying to replace any null values w/a “X”. It seriously can’t be that hard, but I’ve been at it for a couple hours now unsuccessfully. Any input anyone?
Thanks in advance. Ryan
image

Hi @rhowlett

That’s a job for the Missing Value node. Simply add the column where you want to change null values and select what kind of replacement value you want to apply.

After:

image

1 Like

Cleary time for me to walk away for a few - I can’t believe I missed that…Thanks for responding - I sincerely appreciate it. Ryan

2 Likes

No problem, happens to all of us at some point :slight_smile: If you encounter more complex situation in the future, you can also go the coding route but then I would recommend something like this (simple example):

if (column("column1") == null) {
    "X"
} else {
    column("column1")
}

The replace() can’t handle nulls like that since it’s looking for a string.

3 Likes

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