I want to group and count features with the same code attribute value.
I can classify the data and enable feature count in the layer list but I cannot get counts in the attribute table.
aggregationattribute-tablecountfields-attributesqgis
I want to group and count features with the same code attribute value.
I can classify the data and enable feature count in the layer list but I cannot get counts in the attribute table.
Best Answer
With a "Virtual Layer" through
Layer > Add Layer > Add/Edit Virtual Layer...
. you can now use SQL on any layer in QGIS, for example the airport shapefile from the QGIS sample data:To count the number of airports by USE type and compute the average elevation use:
The results are loaded as a new layer: