You can use thea Fixed table
to do that, instead of an Attribute table
.
Add lines/columns according to your needs, and in the surface expression, use the relevant expressionsformulas for 'circles', 'squares' (I have 'rect' and 'hex' here): with a filter on "desc" = 'circle', 'square', or no filter at all forassumming that the total sum.layer is named 'shapes':
For Circles: aggregate('shapes','sum',$area,filter:="desc"='circle')
For Squares: aggregate('shapes','sum',$area,filter:="desc"='square')
For the Total: aggregate('shapes','sum',$area)
As this Table is not tied to a particular layer, the aggregate function does the job to :
- select the appropriate layer,
- do the math: function/expression (sum the $area),
- and filter on "desc" properties to get the desired subset/total