Hi,

You can try the direct but implicit represent_value() function, if the filtering is by the referenced column, like this:

represent_value("referencing_field") = 'filter_value_on_referenced_layer'

Or you can try the more verbose and more explicit attribute()/get_feature() functions, if you want to filter by another column:

attribute(get_feature('referenced_layer_name', 'referenced_field', "referencing_field"), 'filter_field') = 'filter_value'

And be careful about quotes: 'foo' (single quotes) is a string (but may designates a field in other layer in some functiones), while "foo" (double quotes) designates a field in the active layer.

Hope this helps!

Yann

Le 28/05/2020 à 19:11, Patrick St-Hilaire a écrit :
Hi !

Could someone tell me how to query a layer from fields of another layer using select by expression? I have already created a relationship between my two layers in projects.

Thank you

Patrick

_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to