[Qgis-user] How to change what fields QGIS layout text tool reads?
Andreas Neumann
a.neumann at carto.net
Wed Jun 26 00:44:48 PDT 2019
Hi,
I assume there is some kind of relation with common IDs or spatial
relations between the coverage layer and the two other layers?
If yes, any of the three methods I proposed should work fine.
The text tool can only work with the coverage layer in Atlas context.
All other layers will need to be retrieved through other methods, like
the ones I described.
Have a look at the examples (help) of the the get_feature() and
get_feature_by_id() functions. They should help you get going.
If not, then share with us the expression you tried.
Andreas
On 2019-06-26 09:33, Ville Koivisto wrote:
>>
> Hi,
>
> Thank you very much for your prompt answer. I have an atlas in the making that has at least three different layers in it, one naturally being the coverage layer. I have several text boxes in the atlas which are supposed to retrieve useful info from one of the layers. Syntaxes differ, simpler ones being for example:
>
> concat('The value is', "Field")
>
> ...and I've been unable to fetch that "field" successfully. I assume that get_feature() / get_feature_by_id() and attribute() will get me further in this. By what logic the text tool chooses a layer from which to initially read fields (i.e. values user can check and use from drop down-menu _fields and values_)?
>
> Best regards,
>
> Ville Koivisto
>
> FROM: Andreas Neumann <a.neumann at carto.net>
> SENT: Wednesday, June 26, 2019 10:21 AM
> TO: Ville Koivisto <ville.koivisto at kuntotekniikka.fi>
> CC: qgis-user at lists.osgeo.org
> SUBJECT: Re: [Qgis-user] How to change what fields QGIS layout text tool reads?
>
> Hi,
>
> What expression did you use?
>
> Here are some ideas what you could do:
>
> * get_feature() / get_feature_by_id() and attribute() - here you need some logic how to retrieve the related feature from the other layer
> * relation_aggregate() - allows you to have more than one match in the other layer and create aggregates
> * joins on layer properties - for 1:1 joins - needs to be done on layer properties
>
> If you clarify more specifically what you want to do, we can more easily help.
>
> Also, if you have your expressions to share that you tried, it would help.
>
> Greetings,
>
> Andreas
>
> On 2019-06-26 09:06, Ville Koivisto wrote:
>
>> HI LIST,
>>
>> I'm trying to add several texts to my layout and configure their contents by an expression. The problem is that the fields that expression dialog offers me under _fields and values _are from one certain layer and I need them from another one. I'm struggling to find a way to fetch fields from two other layers participating in the layout.
>>
>> If I try to use their fields in an expression I get:
>>
>> _Eval error: Column "Field" not found_
>>
>> _ _
>>
>> How to solve this? Thank you for your attention.
>>
>> BEST REGARDS,
>>
>> Ville Koivisto
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user [1]
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user [1]
Links:
------
[1] https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190626/a0989e7d/attachment.html>
More information about the Qgis-user
mailing list