[GIS] Way to find minimum value from a group of values – QGIS

distanceexcelfield-calculatorqgistable

I'm wondering if there is a way to find the minimum value of a group within QGIS? Basically I need to find the minimum distance of each unique value in a table of about 5000 records.

I can do the analysis in excel using vlookups, etc, but wondering if there is a method in QGIS that will allow me to miss out the excel stage and avoid joining tables. I can't figure out what I need in the field calculator.

enter image description here

I need to find the minimum value for each TOID and remove anything that is not the minimum. Hope that clarifies.

Best Answer

You could use the Group Stats plugin from Plugins > Manage and Install Plugins. This calculates various data statistics for your attributes such as finding the minimum value in a group. I made an example of attributes from the data you gave:

Example attributes

Then from the Group Stats interface, select and drag the toid field from the list into the Rows window; and repeat for the HubDist field and the Min option for the Value window. You should then get the minimum values for your group which you can then export to clipboard or to a csv file etc (i.e. ignoring values other than a minimum. You can then import this back into QGIS as a Delimited Text Layer).

Group Stats plugin interface

Hope this helps!

Related Question