3

I have a line layer which contains the attributes "id" and "network_cost". There are lots of objects with the same id. For example, there are 500 objects with the id "ABC", another 500 objects with the id "DEF" and so on. Each object has different values in "network_cost".

Now, for each id I want to filter out the object that has the lowest value in network_cost and drop all the other objects. Is there a way to do this in QGIS?

1 Answer 1

3

Use Select by expression with this expression:

network_cost = array_min ( array_agg( network_cost, id))

Screenshot: the two blue lines are selected. Invert selection (2nd icon to the right of the highlighted one) and delete all other features: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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