4

I have a geojson file with all my data, in QGIS I only want to display some points and have tried to filter them through symbology for the layer doing so by making them categorized points and using an if statement in the value field to filter any points that aren't the ones I'd like. So far I've managed to create

if("FIELD A"=1, if("FIELD B"='a',1,2),0) 

which is working but when trying to add in an if statement to filter a field by whether there is an integer or NULL in the field i.e.

if("FIELD C"=NULL,1,2) 

It always comes back false (2). I don't know if this is the best way to go about this either but I thought it was the most straight forward way without editing my data.

1 Answer 1

7

For use of 'NULL' you will need to use 'IS' not '='.

Your query will become:

if("FIELD C" IS NULL,1,2)
1
  • 1
    Thank you, this did work I have found out that my data I'm working with is weird as that all FIELD C is only filled with integers for different features than FIELDS A & B. Oct 19, 2022 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.