[GIS] Using Query Builder with Joined table in QGIS

qgis

When I join a layer with another layer all the attributes are correctly displayed in the first layer.

However when I use the Query builder (Layer – Query) and then use Zoom to layer, nothing is displayed.

I have added a vector layer with attribute values from Excel and joined it with another layer consisting of polygons. The polygon layer then displays all the attributes in its table from the Excel imported layer. When I want to view only selected polygons using the Layer > Query using the joined attribute values and use Zoom to Extent nothing happens.

Rule-based styling seems to be the answer.

Best Answer

As far as I know Query Builder is not supported yet for layers with joins, at least not on QGIS 1.8 on MacOS.

Query Builder button in Layer Properties > General window is disabled and Query item in right click menu on layer is not shown.

All you can do is use rule-based styling for showing/hiding elements on the layer with joins (Layer Properties > Style).

If you want to perform dynamic selections and zooming you can use the Advanced search in the attribute table view (right click on layer > Open Attribute Table; in the right bottom part of the window you'll find Advanced search button). This will permit you to select features using SQL on all layer's fields, and you'll be able to zoom to selected features.

Anyway, I agree with you: query builder on joined layers would be a useful improvement!

Related Question