September 10, 200421 yr 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.)
September 10, 200421 yr 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?
September 10, 200421 yr Author 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
September 10, 200421 yr Put the total field (type summary) in the child table. Then put this field in the parent layout.
Create an account or sign in to comment