This question already has an answer here:
I have an attribute table with a real data type column named "Volume". Some of these cells have no value, and I want to replace the NULL with a dummy value like -999. In the Field Calculaor I select "Update Existing Field", select the "Volume" field and I attempt the following:
1) I code
CASE WHEN NULL THEN -999 END - Result: the entire column becomes NULL.
2) Then I try
CASE WHEN "Volume" IS NULL THEN -999 END - Result, the NULL valued cells now show -999 BUT all the other formerly filled cells are now NULL.
After many hours of trying other expression variations I can't figure this out. My guess is I am missing a basic concept.
Oh, and how can I "undo" a bad field calculator update besides quitting QGIS and discarding the updates.