Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a layer to analyze and I want to create a thematic map with rule based feature. There is a strange behaviour. I want to find all objects with no data (NULL). All empty objects. The zero value for me is a value. I write:

namefield = ''

The result is zero but I have 47 objects with NULL value. This is an error. The strange behaviour is if I write:

namefield != ''

The result is 56 objects. This rule works. It is impossible to find objects with no data but qgis find only objects with a value.

Is this a bug or a feature?

It is a bug for me!

I use qgis 1.8


share|improve this question

NULL is not equal to ''. That's why the query doesn't return what you are looking for.


namefield IS NULL
share|improve this answer
namefield IS NULL is OK Thanks – user12916 Nov 19 '12 at 16:54
@Lorenzo If your problem is solved, please accept the answer. – underdark Nov 19 '12 at 17:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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