I've been trying to use this feature but I'm not being able to make it work. I'm using this syntax:

relation_aggregate(relation := 'tubo_et_face_et_inicial', aggregate := 'sum', expression := "lenght_linear")

to try to sum up all the values in the "lenght_linear field of the child table, to a virtual field in the parent table. Is this syntax correct, or am I doing something wrong?

  • 1
    try to write without tags: ('Tubo_et_face_et_inicial', 'Sum', "lenght_linear") it works? tags you can not use them if you respect the order. – pigreco Dec 27 '16 at 16:41
  • Documentation is here but no more precions: github.com/qgis/QGIS-Enhancement-Proposals/issues/59 – jlSta Jan 30 '17 at 16:14
  • @user88753 expression:= "column_label"_ must be in the child table. Maybe save your project , close and reopen. Tested and works on 2.18.3 – jlSta Jan 30 '17 at 16:42

In <= 2.18.6, after you added a new relation in project properties:

  1. Save the project.
  2. Restart QGIS
  3. try again the field calculator with your formula.

It's what i have to do to make it working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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