When using if-conditions with QGIS expressions, the syntax is:
if(condition, result_when_true, result_when_false)
I would like to get an empty value (avoid creating a value at all) for the third argument, result_when_false
. It should not be an empty string ''
or NULL
, but no value at all.
Context: When using an if-condition inside an array_foreach()
function, for each element with empty output (result_when_false
), a ''
or NULL
is added. How to avoid that and add to the array only an element if the condition is true - thus only the result_when_true
outputs?
What I tried and what works, but is more of a workaround is to use array_remove_all()
to delete the ''
or NULL
elements from the array.
However: is there a simpler option to avoid getting an output for result_when_false
?