I'm a total newbie at coding. I'm working with water catchments in QGIS. Runoff of some catchments feeds other catchments. I'm trying to get the cumulative run-off.
Each feature in the table has the following fields:
ID
- each polygon's numberFed by
- the numerical ID of a polygon that feeds itC
- the (calculated) runoff capacity of that field
I would like to create a field C-in
that pulls the value of C
from another feature based on the ID
of that feature if it is written in Fed by
field.
I imagine it is something along the lines of: When Fed by
equals the value of an ID
, get C
of that ID
, for example:
In particular, we have:
ID
: 19,Fed by
: 9,C
: 0.5ID
: 20,Fed by
: 19,C
: 0.7
So C-in
of ID=20
should be: 0.5 (forget for a moment the C-in
of ID=19
)
So what do I need to write in the field calculator to get this magic to happen?