2

I would like to add value from layer “X” field “Y” with ID “1” to the label in my print layout with expression.

I don’t want to use atlas generator because I want this to be 1 layout with all of the data. Let’s say a kind of schematics.

I tried may expressions but nothing work. I will add that i’m not that advanced in writing expressions in qgis.

At this point I think that it is not possible. Somebody please help.

1
  • 1
    Welcome to GIS SE. Can you please make your question more specific, illustrate what you expect and what you have tried so far. This will make it much easier for anyone to provide an answer to your question.
    – Kasper
    Commented Aug 1 at 12:11

1 Answer 1

4

this can be achieved with the get_featureand attribute functions:

attribute(get_feature('X','ID',1), 'Y')

get_featurewill get the feature in layer Xwith the value 1in field ID and attributewill get the value of this feature in the column Y.

enter image description here

1
  • Very nice! Your expression worked flawlessly, except when column Y = the fid, nothing would display. Weird...
    – Stu Smith
    Commented Aug 3 at 5:12

Your Answer

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

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