I'm trying to write formulas/expressions for selecting purposes. I want to create a fixed table in a report layout, and for let's say one particular cell, I'd like to retrieve data from a SELECTED polygon (part of a shapefile or geo-package) ONLY from one specific cell, called "name" in my case. After writing the expression, the cell will be automatically filled in with the name "Sankt Thomas K..." in this case, or that's how I believe it should work. It should work on selected elements/polygon in this case, as I am hoping every time I select another polygon the information in the fixed table will be updated. Anyone?

enter image description here

enter image description here

  • Does this answer your question? gis.stackexchange.com/questions/430478/… Commented Mar 9, 2023 at 12:41
  • I've tried it too, but so far it doesn't work (I must do something wrong. My knowledge in this regard is limited). I selected a building from my buildings layer; then I opened the report layout I created previously, then did select my fixed table, and click edit table; then for a certain cell in this table, I'd choose to write an expression in order to retrieve the data from the selected object/polygon's attribute table, for a particular field in this attribute table 'name' or 'code' for instance.
    – Marius C.
    Commented Mar 9, 2023 at 13:37
  • I did try different expression formats but none of them seems to work so far; in the fixed table's cell will appear the actual formula I typed in the expression editor and not the value from the attribute table. if(is_selected(), name,' ' )
    – Marius C.
    Commented Mar 9, 2023 at 13:38
  • Another observation would be that when I'm in this report layout > fixed table > edit table > select cell > expression editor, the "fields and values" field on the right is NULL, and not the fields and values corresponding to my project layer.
    – Marius C.
    Commented Mar 9, 2023 at 14:15


Your Answer

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

Browse other questions tagged or ask your own question.