Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace null values in cell

Tags:

openrefine

I am unable to replace null values in cells. I have created a facet to only display cells that have null values. I then went to edit cells > Transform function and tried to use the replace function but it does not seem to be working.

Different things I have tried:

replace(value, null, 'other_text')
replace(value, 'null', 'other_text')

I expected the null values to be replaced with 'other text'

Screenshot:

enter image description here

like image 799
Chris Smith Avatar asked Sep 11 '19 05:09

Chris Smith


1 Answers

You are not replacing the value null, but the string 'null'. The correct syntax for replacing is value.replace('old','new') or replace(value,'old','new'). But replacing doesn't work on null. You should either create a facet for null-values (your current screenshot shows some non-null-values) and fill the expression field with 'new' or you could do something like if(value==null,'new',value).

like image 105
CennoxX Avatar answered Nov 16 '22 15:11

CennoxX