Saturday, 14 December 2019

Sum values in a field for selected features QGIS



I'm a new user trying to perform very simple operation but I'm completely stuck. I'd like to be able to select a number of features on the map and then get the sum of a particular field for only the selected features, on the fly. For example, summing the population fields for a number of counties that I've selected on the map. I don't need to store the sum in any way, I just need to quickly get it for reference.



Answer



The Statistics Panel displays various calculations based on a field.



  • To open the Statistics Panel, click the epsilon button in the Attributes toolbar.

  • Select the layer from the dropdown menu at the top of the stats panel.

  • Select the field from the dropdown menu below that.

  • At the bottom of the panel, check the box for "selected features only." Otherwise statistics are calculated for all features in the layer.

  • To choose what types of stats are calculated, use the "..." button at the bottom-right of the panel.



enter image description here


Screenshot is from QGIS 2.18. The stats panel also exists in QGIS 3.0.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...