[Qgis-user] Problem filtering table on columns with NULL values

chris hermansen clhermansen at gmail.com
Thu Oct 15 07:56:58 PDT 2020


Bernd and list,

On Thu, Oct 15, 2020 at 5:18 AM Bernd Vogelgesang <bernd.vogelgesang at gmx.de>
wrote:

> Hi,
>
> just hit a problem when working with a table from an .ods file.
>
> To work with the data, I have to exclude some values from a field, where
> some entries also have NULL values.
>
> When I now filter on the value I do not need ("field" != 'xyz'), also
> the rows with  NULL values in that field are filtered out, which is not
> what I want.
>

In databases that support NULL values it's customary to use "IS NULL"
rather than "= NULL".   The rationale is that a boolean expression
involving NULL values can't be true nor false since the meaning of NULL is
"unknown".


> As I do not want to "invent" data for those rows just to make it work, I
> wonder if this is a bug or if there is a workaround for this problem.
>

I just tried this with the QGIS select calculator (IS NULL) and it seems to
work fine there.




-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201015/17f7b618/attachment.html>


More information about the Qgis-user mailing list