I have a point layer, consisting of 12 points with fid
1 to 12. I want to render points with fid > median (fid) - thus in this case, point 7 to 12.
That works perfectly if using geometry generator with this expression - see screenshot, where only 7 to 12 are rendered, whereas 1 to 6 only have labels/callouts:
if (
"point_id" > median (
"point_id"
),
$geometry ,
''
)
However, when I use the same expression with Menu Processing / Toolbox /Geometry by expression on the same point layer, I get an error: Cannot use relation aggregate function in this context
. Why is that - or asked the other way round: how to correct the expression? It's the same expression as in geometry generator in rather the same context.
I am asking specifically about this relation aggregate function
error, as I already encountered it several times in more complex cases. In this simple case, of course there would be easier ways to achieve the goal. However, I wanted to present a simple case to make the error easier to reproduce.