Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculating the sum of related records.

Featured Replies

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 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?

  • 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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.