My QGIS Field Calculator expression:
case when "field_value" = '' or "field_value" <> NULL then (if( "field_value" = '', 'N', 'Y')) end
returns null value even if "field_value" has something in it.
Note: "field_value" is in string.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityMy QGIS Field Calculator expression:
case when "field_value" = '' or "field_value" <> NULL then (if( "field_value" = '', 'N', 'Y')) end
returns null value even if "field_value" has something in it.
Note: "field_value" is in string.
(Edited answer)
I think you can safely replace your main condition with "field_value" is not NULL
(the comparison with null
is somewhat counter-intuitive):
case
when "field_value" is not null then if( "field_value" = '', 'N', 'Y')
end