Bug report #14746

Joined fields doesn't display in atlas composer

Added by Christophe Damour over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:2.14.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22703

Description

This expression doesn't work :
[% attribute(@atlas_feature, 'Pop_Dpt_INSEE_POP_06')%]
POP_06 is a joined field from Pop_Dpt_INSEE csv table.

By the way, it's weird that simple quotes are required for field names in attribute function instead of double quote.
As a result, double clicking on a field name to insert it doesn't work...

Associated revisions

Revision febe30d9
Added by Nyall Dawson over 8 years ago

[expressions] Fix fetching joined column refs when expression is
not prepared (fix #14746)

Revision dd4ae416
Added by Nyall Dawson over 8 years ago

[expressions] Fix fetching joined column refs when expression is
not prepared (fix #14746)

(cherry-picked from febe30d991111712f95a476e97862ca5a890b9aa)

History

#1 Updated by Jürgen Fischer over 8 years ago

  • Subject changed from Joined fields doesn't dispaly in atlas composer to Joined fields doesn't display in atlas composer

#2 Updated by Nyall Dawson over 8 years ago

Your expression is wrong. Just use

[% "pop_DPT_insee_pop_06" %]

#3 Updated by Harrissou Santanna over 8 years ago

Christophe Darmour wrote:

By the way, it's weird that simple quotes are required for field names in attribute function instead of double quote.

You'll find answers at the end of this discussion. However,

As a result, double clicking on a field name to insert it doesn't work..

seems a valid remark though it may not be easy to fix. Users can indeed be puzzled even though there's a help along the function. I think the QGIS doc should be full of this kind of subtle usage to help user be really aware of them (and the potential of the expression builder).

#4 Updated by Christophe Damour over 8 years ago

Thanks for the answers.

@Nyall : I tried with the field name alone, as you suggest, but it didn't work either. I also tried [% attribute($currentfeature, 'Pop_Dpt_INSEE_POP_06') %] with no luck. However, it works perfectly for normal fields (not joined).

@Harissou : Explanations in the discussion you linked to make sense. They helped me to understand the syntax.

But then, if the way to go is the field name alone, what is the purpose of the attribute function ? Former versions compatibility ?

#5 Updated by Nyall Dawson over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF