I want to label the sums of surfaces ("Groesse") grouped by common attribute values ("Block") in QGIS 3.16. I need one label for each group.
The following pictures help to describe the expected result.
Here is an example of my attribute table:
Here is the result I want to get. 5 sums grouped by the "Block" column are represented below: 3 orange (D1, D2 and D3), 1 grey (S1) and 1 green (G1)
I thought to create a virtual layer with a function that sum the surfaces (
"Groesse") per attribute value("Block"). Despite my attempts, I do not know how to write it correctly in SQL (sum("Groesse","Block") in Python).I also tried to display labels through a Rule-based expression in using the aggregate function, without success.








