I have a point layer named 'observation'
, with different attributes and one called "Année"
. My project also have a variable called @Année
.
In the layout, I have a A0 page (1189x841), but I want an extra space to put my attribute table (1cm for each row). So I'm trying to calculate the size with this formula, and it's worked fine:
841 + (10 * layer_property('Observation', 'feature_count'))
My problem is that my attribute table shows only the observations for the given year (@Année
), with this formula:
to_string(year("Année")) LIKE @Année
How can I adapt layer_property('Observation', 'feature_count')
to add a filter, so it will count only the observation for a given year?
(EDIT)
I tried the solution with aggregate
, but it doesn't work, cause it says "No feature was found on this layer to evaluate the expression", so I can't click on OK.
(EDIT2) The expression works to calculate a field for exemple: But as an expression to set the size of the page, I still have the problem... and it's exactly the same expression:
filter:=to_string(year("Année")) LIKE to_string(@Année)
and trailing coma at the end ofexpression:=...
line to see if it works withoutfilter
. It's the equivalent oflayer_property('Observation', 'feature_count')
. The goal is to sort out where is the issueaggregate('aa_6d49a2f5_1d8a_478d_8a79_96d0b1af30a8', aggregate:= 'count', expression:='Année du relevé')
.