1

I'm working with two layers right now - a line layer called Water Lines and a polygon layer called Land Areas. The Land Areas layer has polygons in which water runoff occurs during precipitation events. That Runoff Estimate from each polygon feature is received by a Receiving Water Line Feature, which corresponds to a feature of the same name in the Water Lines layer. A single Water Line feature can receive runoff from multiple Land Areas polygon features.

I want the field Total Collected Runoff for a given Receiving Water Line Feature Name in the Water Lines layer to sum the Runoff Estimate values for all polygons in the Land Areas layer with the matching Water Line Feature Name in the Receiving Water Line Feature field.

Water Lines attribute table

Land Area attribute table

1
  • A diagram or screenshot would sure help me understand what you need! Please edit your question accordingly.
    – Stu Smith
    Jul 23, 2022 at 18:21

1 Answer 1

1

You can use an expression like this to update the field Total Collected Runoff (gal) of the layer Water Lines.

I took the field names currently displayed, but maybe there are aliases, so modify it in the expression if needed.

aggregate(
    layer:= 'Land Areas',
    aggregate:= 'sum',
    expression:= "Runoff Estimate (gallons)",
    filter:= "Receiving Water Line Feature" = attribute(@parent, 'Water Line Feature Name')
)
1
  • Exactly what I was looking for! Thank you
    – Brightside
    Jul 31, 2022 at 19:50

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.