Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

children totals into parent record


This topic is 4159 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

To make my request simple, suppose I have multiple children records for each parent record. In each child record there is a number. I want to add up that number from each of the children records for each parent and put that total in the parents record. I know you can have summaries on a report, but how do you get the total into the parents record? As an example, if each child record contains the amount of a tuition payment for a particular family. There are a number of these payments during the year. I want to total that amount for the year and put that amount into the parent record as total tuition paid by each family for the year. Make sense? Help?

Posted

Every time a child record is created or modified (Script Trigger / OnRecordCommit ) push the total of all the child records with the same parent ID to desired field in the parent record. You can do it with a relationship or ExecuteSQL:

 

 

ExecuteSQL ( "

SELECT
sum ( c.amount )
FROM
child c
WHERE
c.id_parent = 
 
" ; ", " ; "¶"; id_parent )
Posted

The Sum function will add up all the numbers of related child records. The calc field using the Sum function would be in the parent table.

This topic is 4159 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.