[Qgis-user] How to change what fields QGIS layout text tool reads?

Ville Koivisto ville.koivisto at kuntotekniikka.fi
Wed Jun 26 00:33:45 PDT 2019


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<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: 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/464d24d7/attachment-0001.html>


More information about the Qgis-user mailing list