[Qgis-user] Map Composer and Attributes from a layer

Nyall Dawson nyall.dawson at gmail.com
Sun Dec 7 13:50:07 PST 2014


On 8 December 2014 at 07:08, Randal Hale
<rjhale at northrivergeographic.com> wrote:
> That does give me a workaround of sorts....
>
> Is there any way to pull from a table and place the information in composer
> - a table that isn't being used by Atlas?
>
> .....But Alexandre's idea might give me a work around in the meantime.
>

Atlas IS the correct way - it's not a workaround ;). However, if
you're after an expression, then use a combination of getFeature and
attribute. This is how it works:

First, use getFeature to find a matching feature from a layer:
getFeature( 'my_layer', 'id_field', 5)
This will return the feature from "my_layer" with the attribute
"id_field" equal to 5.

Next, chain this into attribute:
attribute( getFeature( 'my_layer', 'id_field', 5) , 'feature_name')

This will return the value stored in the attribute "feature_name" from
the matching feature from "my_layer".

Hope that helps!

Nyall



More information about the Qgis-user mailing list