I have a polygon layer with a Value Relation field that I'm using to capture upstream catchment areas that contribute to the selected record.
An example would be if I had 3 polygons of 100m2 - so I have 3 records in my table with a geometry area of 100m2. But polygons A & B contribute to the catchment area of polygon C, so I use the Value Relation field to identify A & B as contributors to C. I use the Value column to identify the polygon, but I use the Key column to save the area geometry values in the column. I then want to add a virtual field to calculate the sum of the values in the Value Relation field and add it to the area of the particular record. In this case, I would have a virtual field of 300m2.
The problem I'm having is summing the values of the Value Relation field (Real) - as soon as I save the table, I lose the values in the Value Relation field. Everything becomes zero.
I've been trying with the "UP_AREA" field as both a text and as a double. The text values seem to remain in the table, but the doubles are not showing up. In the screen shot at the bottom, you can see that the AREA_ha values are being saved, but I'm not able to convert to real.
The last screenshot below shows that the values appear as expected in the UP_AREA_D field as expected when the polygon is drawn, but as soon as I save the table, the field returns to null.
Open to any and all suggestions if anyone has a better way to do this.