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.

Trying to count related records matching a condition

Featured Replies

Using FM6, I've got a calculation field that is attempting to count the number of related records that match a condition. The code I am using in the calculation field is:

Case(Client License Changes::date_submitted ≥ Date(7, 1, 2006), Count(Client License Changes::license_change_id))

I am trying to get the number of related records in the Client License Changes file that were submitted after July 1st 2006. Unfortunately the result continues to be equal to blank.

This is one of those things that I could swear I had working a week ago during the initial development and testing, but it fails to work now.

Can anyone shed some light on what I am doing wrong?

Thanks,

The problem with your formula is the test portion of the Case statement. While Aggregate function (like Count) can look at all the records related to a master record, a simple reference to a related field only looks at the first related record. I think the easiest way to approach the problem would be to create a calculation called LicenseFilter in the Client License Changes file something like this:

Case(date_submitted ≥ Date(7, 1, 2006), 1)

Then, change your current formula in the other file to the following:

Sum(Client License Changes::LicenseFilter)

  • Author

That appears to have solved my problem, thanks for the suggestion. One question, has something changed between FM6 and FM8 because when I took the same files and converted them to FM8 and ran it there, it appeared to work correctly.

Thanks again,

The calculation you originally posted won't work in any version of FileMaker. Sorry.

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.