4

I am creating an atlas using QGIS v3.12 but would ideally like to include a dynamic text box that takes values from multiple layers contained on each atlas feature page.

The map is made up of two layers ('zones' & 'networks') 'zones' used to generate the atlas, but I'd like to include some of the attributes from 'networks' including 'total_properties'.

I've tried using:

aggregate(
layer:='networks',
aggregate:='concatenate', 
expression:="total_properties",
filter:=intersects($geometry,@atlas_geometry),
concatenator:=','
)

But it returns the error "Eval Error: Could not calculate aggregate for: total_properties".

It only seems to work if the attribute name is common with the 'zone' layer (they are different geometry types from different sources but have some common attributes). I even created an attribute table for 'networks' and copied the attribute names from the expression builder to ensure they're spelt correctly.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jun 8, 2020 at 17:31

1 Answer 1

4

This is probably because your total_properties field is numeric and concatenate only works on string data types (why QGIS doesn't autoconvert numeric values for this is beyond me - perhaps in a future release).

Try using expression:=to_string("total_properties") in your expression and see if that works.

answered Jun 9, 2020 at 3:34
1
  • Fantastic - thank you!! Ended up using 'expression:=format_number(total_properties,0),' but worked perfectly! Commented Jun 9, 2020 at 7:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.