Skip 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.

Seemingly simple calc. results in no output

Featured Replies

I have a student table related to a teacher table. If a student is a male, he gets a 0. If a student is a girl, she gets a 1.

In my teacher table, I wanted to create three basic calculations to determine the # of boys and girls in each teacher's class, however, what I thought would be straightforward calculations just aren't resulting in ANY data whatsoever.

There are three fields I have calcs for in my teacher table:

Total male students

Total female students

Total Students

My thought process was:

Total_Female_Students = Sum (Students::Gender)

Total_Students = Count (Students::Teacher_IDfk)

Total Male Students = Total_Students - Total_Female_Students

At first, I thought the correct syntax for the Count calculation was Count (Students::Teacher_ID)

However, this syntax resulted in the error "the specified field cannot be found", because I don't have a field of Teacher_ID in the student table, just a Teacher_IDfk field.

Any suggestions? I'm sure it's right in front of me, and it's driving me crazy! All I'm staring are blank fields right now--clearly the calculations aren't working, but I'm not sure why...either incorrect syntax, or some sort of relationship problem?

Thanks in advance!

You should have posted this in the original thread:

http://fmforums.com/forum/showtopic.php?tid/211095/

Students::TeacherID is the name I used in the example for the matchfield in the Students table (the foreign key to the Teachers table). In your implementation, you need to use your own field/table names.

Note that these calculation fields need to be in the Teachers table.

Edited by Guest

try using the Summary field type for field 1 and 2 instead of functions Count() and Sum()

  • Author

Sorry about the misplacement of the post.

In the teacher field there's Teacher_ID

In the student field there's Teacher_IDfk

Count ( Students::Teacher_IDfk )

I thought my syntax was correct, but I'm not getting anything. I really have no idea how to brainstorm possible reasons this is getting tripped up. Any help would be very, very appreciated. Thanks for your patience!

  • Author

I'm confused. When I try the sum option, it only lets me sum fields within the teacher table, which doesn't help, as I want to sum records in the student table. These two tables are related, yet I can't sum student records in the teacher table.

Am I doing something wrong?

  • Author

Sorry everyone. I figured it out. Human error strikes again. Thank you for your patience and feedback.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.