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.

Calc for counting number of times an entry made

Featured Replies

Is there a reliable way to make a calculation field that tells dynamically when a person enters and "x" into a field. So if there are 240 records but 112 have an "x" it would constantly total the number of x's/ That is what I need to do somehow . If you can help with this please do so. Thanks very much.

STAN

Two calculations:

PatternCount( field, "x" )

and

Sum(rel::pcfield)

where rel is a self-relationship based on a constant field equal to 1 or a Cartesian join in version 7.

  • Author

Thanks for the answer. But can you explain the second Calculation. I just don't understand what you mean.

  • Author

Actually, there is another problem. There can only be one "x" per record. So in my above example there are 112 records with the "x" in that field. I am looking for something that will count all the instances of "x" in all the records dynamically, Is this possible.

Thanks Again

Stan

The first counts how many times "x" appears in 'field' for each record. The second sums the result of the first for all records in the table. If you are not using version 7, then you'll either create an auto-enter number calculation of 1 for the file or a calculation number field of 1 and relate this field to itself so that each record relates to every other in the file.

What they are trying to tell you (and if you don't use FMP 7 yet like many of us), Create a Self relationship.. Give your table a field called @Constant.

Make this a text field that auto enters 1 (you might need to do a relookup/replace on current records).

Then make a new relationship the points to the same file, using this new field as the match. Now you have a self relationship, this is needed when using functions such as Count, Max, Min etc.

For you problem I would simple use the Count function Which will simply count the number of times a field has a value in it. Otherwise you would need to use the PatternCount or others.

HTH

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.