automatic surface calculation

Hello everybody. I am creating an app for interventions in the countryside. In each intervention I have the choice of land as an enumlist, to choose more land. In the same table (named "CAMPAGNA") I would like to automatically fill the column [SUP. TRATTATA (ha)], which represents the sum of the areas of the land chosen for the intervention that is being completed. The values of the areas are in a second table called "TERRENI". Is it possible to calculate it with an expression?

2022-06-09 18_31_32-Window.png2022-06-09 18_43_27-Window.png2022-06-09 18_43_52-Window.png2022-06-09 18_43_27-Window.png2022-06-09 18_44_42-Window.png

Solved Solved
0 4 117
1 ACCEPTED SOLUTION

4 REPLIES 4

Thanks ... I have read the articles and they are very helpful. My difficulty is in constructing the expression that from  CAMPAGNA[APPEZZAMENTO] enumlist, compares the ID_TERRENO of the enumlist with the ID_TERRENO of the LANDS table, takes the corresponding surface. then Sum the values.
I did tests, but I did not reach a satisfactory result. 

Could you help me with the various steps?

What have you tried?

I was not familiar with the expression IN (). I completed the formula like this:

SUM(
SELECT(
TERRENI[SUP. (ha)],
IN([ID_TERRENO],[_THISROW].[APPEZZAMENTO] )
)
)

Top Labels in this Space