I'm working with QGIS 3.16 Hannover.
I've got a single polygon layer National Park
and another layer with a 1x1 km grid UTM
. In the print composer, I want to include in the legend the number of UTM
grid squares that intersect the National Park
(all features of UTM
with all features of National Park
, so I get one number as result). I've built the following code, but it returns 0.
aggregate(
layer:='UTM',
aggregate:='count',
expression:='COD1X1',
filter:=intersects($geometry, geometry('National Park')
)
)
What's wrong?