droosan Posted September 10, 2004 Posted September 10, 2004 Let's say record Parent1 is related to three records ChildA, ChildB, and ChildC. (If it matters, I am imagining the relationship working by ChildA, ChildB, and ChildC all having the value Parent1 in their Parent field.) The children have a field called Score. Parent1 has a field called Total. I want Total to hold the sum of the children's Score field. I can do this by having a script run down a portal, total them up and stuff the result in Total. It seems, however, there should be an easier way, using a calculation or a summary field. Ideas anyone? Much Grass. (I am starting to mess around with FM7, so if a solution is easier in 7 let me know.)
The Shadow Posted September 10, 2004 Posted September 10, 2004 The solution in FM7 is that the "Total" field is a summary that is a total of Child::Score, the summaries only work over the set of related records. If I remember correctly, FM6 computed summaries from other tables using the found-set in that table, so I think you could do a "go to related record" to get the correct found set in the Child file, then the summary setup in Parent will be correct when you switch back to it?
droosan Posted September 10, 2004 Author Posted September 10, 2004 The solution in FM7 is that the "Total" field is a summary that is a total of Child::Score, the summaries only work over the set of related records. When I try a Summary field, there seems to be no way to get a total of a related field. However, from your suggestion I made Total a Calculation field = Sum(Child::Score), and it worked perfectly. Thanks Drew
transpower Posted September 10, 2004 Posted September 10, 2004 Put the total field (type summary) in the child table. Then put this field in the parent layout.
Recommended Posts
This topic is 7726 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 accountSign in
Already have an account? Sign in here.
Sign In Now