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.

Bug in GetSummary(SumField,related-break-field)?

Featured Replies

  • Newbies

In order to properly calculate student GPAs in a report, I need to total a field called 'credit hours' and a field called 'hours' and divide them as needed.

student-----CH---H

student 1 - 16 - 4

student 1 - 04 - 1

student 1 - 04 - 1

Student 1: 24 - 6 (24/6 = GPA of 4 for this student)

student 2 - 03 - 1

student 2 - 12 - 4

student 2 - 08 - 4

Student 2: 23 - 9 (23/9 = GPA of 2.56 for this student)

Class Tot: 47 - 15 (47/15 = classGPA of 2.86 for this class)

The problem I'm having is with the class GPA calculation (shown only in parentheses above). I need to take the total CH and divide it by total H when the class break happens in the report.

I have two summary fields, totalCH and totalH, that work just fine.

So I have a calculation that looks like this (simplified here)B)

classGPA = Round(GetSummary(totalCH,class)/GetSummary(totalH,class),2)

Now here is what I consider to be a bug:

If the class field is local to the file where I'm doing the report, the class GPA is correctly calculated.

But if I use a related field for the GetSummary break field, i.e.,

classGPA = Round(GetSummary(totalCH,student::class)/GetSummary(totalH,student::class),2)

then I get nothing at all for classGPA. The field is blank, not zero or some other number.

The fact that totalCH and totalH are correct, even when breaking on student::class, indicates to me that my logic is correct but that FMP has a bug here.

I could appreciate confirmations of my reasoning, refutations of same, and workarounds!

-- jeffreyp

If a relational system is used where Students are in one file and their hours are in recorded in another, this would be really easy to do with a calculation field like Sum(Relationahip:field).

No neeed for summary parts or calculations.

  • Author
  • Newbies

Thanks for the tip, Vaughan! I must admit that I'm not sure how I would use it since the actual GPA calculation is:

GPA = ((Sum(Hours of A work) * 4) + (Sum(Hours of B work) * 3) + (Sum(Hours of C work) * 2) + (Sum(Hours of D work) * 1))/ Sum(Hours)

I suppose I could figure out a way to make a relationship "Hours of A", "Hours of B", etc. And I need to break the report at three levels, so I'm even less sure.

But I actually solved my problem by copying the field I needed into the table where the report lives.

However, I would still like to know whether I've uncovered a FileMaker Pro bug with GetSummary() or not. I bet I have.

--jeffreyP

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.