3

I am pretty new to Qgis and a real beginner when it comes to working with expressions in Qgis. Maybe someone can help me with following problem:

Example

I have several Layers (like Building + House) and each of them have specific attributes values that i want to filter. So my idea was to get an extra layer Test with the attribute value that i want to filter on the other layers and put a filter expression to the attribute value A in table category_1 of layer Test. Basically to avoid rewriting the filters for each layer all the time. But I dont know how to get it done. I tried it with get_feature and attribute() but in my Qgis 2.18 there is no help how such expressions have to look like. That makes it really hard if u have no clue. So how can I filter with the attribute value A in category_1 of layer the Test in the layer House ?

1

If this is about Select features using an Expression enter image description here function, please try examples below:

House

"category_2" = attribute(get_feature('Test', 'ID', '1'), 'category_1')

Building

"category_3" = attribute(get_feature('Test', 'ID', '1'), 'category_1')
0

This is rather a task for databases, the filtering across layers based on attributes. GIS' are used to filter across layers based on spatial data.

What you can do: Build a virtual layer (layer -> add layer -> virtual layer) with all your layers you want to filter and use the correct SQL-terms.

  • So it is not possible with an filter expression ? Rather than having any SQL knowledge I already fail to create a virtual layer. I always get errors for spefics layers while using the given import function. So I think this will lead to many more questions. But thx for the Idea. – lancelot1988 Jul 27 '18 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.