Sum values from child table

Hi there,

I got two tables:

Parent: Fatigue
Child: Break_Fatigue

I’m trying to add together the values from the [Total Break] column in the ‘Break_fatigue’ table. And I want the result to show up in the table “Fatigue” on the column [Total Break]. so I’m using the expression below but for some reason is not working and I can not figure out why. I will appreciate your help with this one please

SUM(SELECT(Break_Fatigue[Total Break],[Fatigue_ID]=[_THISROW].[Fatigue_ID]))

Note: when I test the expression, this Error comes up: ‘[ID].[Fatigue_ID]’ : Unable to find column ‘Fatigue_ID’. I have tried to change the type colum to REF (Break_Fatigue) and still not working.

Solved Solved
0 17 3,112
1 ACCEPTED SOLUTION

I’m assuming you are not using a virtual column for the Parent’s Total Break which is good.
In that case, you need to create an action to update the parent’s record everytime you add or edit the child records.

so instead of putting the expression in the column, transfer that to an action and put it in your form to trigger it.
You can check this sample i made for you.

https://www.appsheet.com/samples/Sample-App?appGuidString=3a3ac445-ca26-4ee4-b93f-cc804ced49d5

Cheers

View solution in original post

17 REPLIES 17
Top Labels in this Space