Using the field calculator, I'm trying to update an attribute only if it equals to zero:
CASE WHEN "Z" = 0
THEN
"Z" = rand(1,100)
END
This let the 0 values as they are and updates all others to "NULL".
This IF statement doesn't work either:
IF( "Z" = 0,
"Z" = rand(1,100),
"Z" = "Z"
)
It sets all values greater than zero to 1 and let the others = 0.
What's wrong with these statements?
Z is a double.
I clicked all functions and element in the search list so there shouldn't be any typo.
And what kind of language is this, I can't recognize SQL; it seems to be some kind of "internal to QGIS language".