I'm facing an issue while trying to calculate the maximum value within polygons from another vector layer in QGIS. I've tried using the aggregate function with the 'max' statistic, but the result is always null.
Here's the expression I'm using:
aggregate(
layer:= 'Layer1',
aggregate:='max',
expression:=WLevelMax,
filter:=intersects($geometry, geometry(@parent))
)
I've made sure that the layer names and field names are correct. The strange thing is that when I remove the intersects($geometry, geometry(@parent))
condition, the command works, but I want to ensure the calculation is based only on the polygons' intersection.
Could anyone provide insights into what might be causing this issue or suggest an alternative approach?