I have a line layer with roads. Every road has a unique start and endpointnumber, as attribute. From this layer I want to select some roads. Therefore I have an excel table with start- and endpoint, which I want to select. The road layer and the excel table don ́t have an id, for a join. Is there any option in the query builder, that I can use columns from the table for my query on the line layer?
part of the excel table
part of the attribute table of road layer enter image description here
I want to select all roads with the values of "vnk" and "nnk" from the excel table, but I can ́t join them.
1 Answer 1
If you want to select all road features that have the exact same vnk
and nnk
combination as a row in your Excel table - then you can use this expression in Select by Expression:
get_feature('excel','vnk',"vnk") is not null AND get_feature('excel','nnk',"nnk") is not null
If you want to select all road features where the vnk
value must be in the Excel table, and the nnk
value must also be in the Excel table, but not necessarily in the exact same pair combination, then you can use this expression.
get_feature('excel','vnk',"vnk") is not null OR get_feature('excel','nnk',"nnk") is not null
For both expressions you need to change the name of your excel
layer accordingly (please note it is case-sensitive)
get_feature()
oraggregate()
)