I have a table containing distances from one ID (an address) to another ID (bus stops).
There table contains distances from all addresses to all different bus stops.
Now I want to select the feature where the distance between the certain address and the bus stop is the shortest.
In QGIS I've tried to do something like this:
where:
"meter"
is the distance column;"fromID"
is the address.
There are 16 different addresses and a little more than 6000 features in the table. What I need is a table with only 16 features.
You can, of course, use minimum function as well.
Can anybody help out here?
Answer
You can use the following expression in the Select by Expression tool:
"meter" = maximum( "meter", "fromID" )
This selects all "meter"
values which equals the maximum "meter"
value found for each "fromID"
group.
No comments:
Post a Comment