Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
I think you can safely replace your main condition with "field_value" is not NULL (the comparison with null is somewhat counter-intuitive):
"field_value" is not NULL
when "field_value" is not null then if( "field_value" = '', 'N', 'Y')
Required, but never shown