3

I am working of a map layout in QGIS 3.10. In my layout i am inserting a HTML block. In that HTML block i want to show content by building an expression. This expression will show information from 3 different layers present in map. In below image as show Fields and Values is showing attributes of one layer which is being used in map layout Atlas. I want to utilize other layer attributes as well. THere is an option to to do that so i used following

 get_feature( 'division1_8cc9f2a7_078a_4d49_8e5a_826e54bc33f1', 'memberOr_5',   "STATE_ABBR"  )

But this is returning me first feature of layer which satisfies the queries but there are more then one feature how can i get others ?

ion

7

If you want to get not only one value, you should use the aggregate function in the expression builder. Your expression should be something like this one:

 /*
  collects a comma separated list of the field STATE_ABBR in layer
  division1 with the filter "STATE_ABBR" ='memberOr_5'
 */
 aggregate( 
 layer:='division1',
 aggregate:='concatenate',
 expression:="STATE_ABBR" 
 filter:= "STATE_ABBR" ='memberOr_5', 
 concatenator:=',') 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.