Thursday, 17 December 2015

QGIS select features from attribute table using the "LIKE" operator



I created an expression with the help of the GUI in the QGIS attribute table of a vector (shapefile) layer of Native American ("Indian") reservations in the USA state of New Mexico.


"NAME" LIKE 'Picuris'


No row became selected.


The full "NAME" in the desired row is 'Picuris Indian Reservation' . I don't mind typing the whole name, but in principle, is not the LIKE function supposed to find partial matches? That is, if I want 'State Hwy 68' (which is in the FULLNAME field) (of a different layer), will the LIKE operator not find it if I use "FULLNAME" LIKE 'Hwy 68' ?



Answer



You can also use the column filter of the attribute table. It works default as a 'like' expression without the % wild card.


enter image description here


Result when typing a:


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...