I several times had the same problem using the QGIS expression aggregate
: I got the impression that it behaves somehow buggy - or I make a mistake.
See this expression I use on a point layer:
aggregate (
layer:='points',
aggregate:='concatenate_unique',
expression:=x($geometry),
concatenator:=','
)
The preview shows an error: Could not calculate aggregate for: x($geometry)
. If I click the arrow to the right of the preview to change to the preview for the next feature, the preview changes from error to NULL
. As far as I can see, comparing with the help on the right side, the syntax is correct. Simplifying the expression to aggregate ('points','concatenate_unique', x($geometry))
results in exactely the same problem. I also changed the layer name to the @layer
variable and used an existing field id
to aggregate: aggregate (@layer,'concatenate_unique', "id" )
. However, the very same problem persists.
Is this a bug or do I make a mistake?
x($geometry)
? Maybe one geometry is not correct ?x($geometry)
, with the same error. I had this same problem for several times in different projects with different geometries and layers. So now I'm curious enough to find out if someone else can reproduce the error?