[Qgis-developer] Filter on joined tables

Hugo Mercier hugo.mercier at oslandia.com
Fri Feb 14 01:36:59 PST 2014


We are asked to work on subset filtering when a qgis layer has joined

Currently, the filter feature has been disabled on a layer with joined
fields to circumvent a bug (see http://hub.qgis.org/issues/3858 and

What if you want to implement filtering on a table with joined fields ?

Filtering on fields of the primary table would be ok, assuming we find
another way to circumvent the mentioned bug (propose to rename fields
when saving to shapefiles ?).

Filtering on fields from the joined tables (but not he primary) is a bit
more problematic. We could imagine attributes to joins (within the joins
tab of the property dialog) where users could define a where clause on
joined tables. But the joining function would have to be modified in
order for it to reject rows when rows of joined tables are null (correct?).

For filtering on every possible combination of fields, including those
from the primary table and joined tables, the best option would be to
propose a filter expressiion based on QgsExpression. It means filtering
would happen client-side, after data have been fetched from the
different providers. It's convenient, but not very efficient.

Comments, other ideas ? :)
Hugo Mercier

More information about the Qgis-developer mailing list