As Marco has explained, QGIS expressions are based on SQL which means that if you use a null containing field in a statement the nulls will be excluded from the query results unless you specifically state that they should be included. So you need to say: "tag_service" IS NULL or "tag_service" NOT IN ('alley', 'drive-through', 'driveway', 'laneway','parking_aisle', 'parking') -Thayer From: Andrew Hughes <ahhug...@gmail.com> To: Qgis-user@lists.osgeo.org Subject: [Qgis-user] Select by Expression: exclusive (not inclusive) Message-ID: <CAMvYC1Xs=yaxj6os5vfnnnav_v60tjcqbaut-ygdnutoc6k...@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Hi All, I can't for the life of me figure out why I can't "Select all features that are *NOT* an alley, drive-through, driveway.... " I am trying to use "Select by Expression". The attribute I am trying to filter with is called "tag_service" and has 77 distinct values, including NULL. *Q: Why does this expression select nothing?* *"tag_service" NOT IN ('alley', 'drive-through', 'driveway', 'laneway', 'parking_aisle', 'parking')* Supplementary, the following does select records (but I want the above expression to work): *"tag_service" IS NULL or "tag_service" = "service"* Help would be much appreciated, Thank you Andrew
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user