11

Below is a screen shot of my Layers Panel showing two Graduated Category layers. One set of category features (Change in Small Firms (2015-2010)) are accompanied by counts, while the other (Change in Small Firm Counts (2015-2000)) is not. The counts for the first show up in the Composer output, but not in the second. I'd like both legends to be similar, but I can't figure out how to add or remove the counts.

Layers Panel

1
  • In the example shown for the feature counts, is there a way to select the sum of the points in each category of a different field other than the feature count shown? I have point counts in my layer, but the categorized data is from a different field in the same layer. i want to see how many points fall in a given percentage of categorized polygons. Thanks!
    – dave
    Commented Aug 11, 2017 at 19:23

3 Answers 3

12

You may try a right click on your layer and then chose to Show Feature Count (green on figure):

qgis menu

5

Right-click the entry in the layer list and activate Show feature count. (Can be heavy on big datasets but yours doesn't seem an issue.)

0

To have more control on what you count and how you present the count (ie, to get rid of the brackets), use an aggregate expression in the appropriate legend label (+ Insert or Edit an Expression) and combine it with concat(). This one's to count features within the atlas geometry and also belonging to one category:

concat('My count: ',
  aggregate(layer:='A LAYER',
    aggregate:='count',
    expression:= A FIELD,
    filter:= within($geometry, @atlas_geometry) AND "FIELD"=VALUE))

(Note that when closing the Insert Expression window, a [%%] will enclose your expression in the Label window.)

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.