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.

Count instances of specific values in a field

Featured Replies

  • Newbies

Is there anyway I can get FM to return in (a) summary field(s) the number of instances of several specific values from a single field? e.g. How many times "10" appears, and how many times "20" appears, and how many times "30" appears etc.

Thanks, Ben

One way is to set up a Summary field and a layout which provides sub-summaries when sorted by the value in question. Then perform a find to locate the values you want to check on, switch to your sub summary and sort and you will get the breakdown.

Another way is to set up a script which does a find for each of the values in turn and writes the number of records found to a global field.

A third way, which has the advantage of dynamically updating its display as anything in the database changes, could be achieved by:

1. Creating a global number field to hold each value you want to count,

2. Create a self-join relationship which links each of the global fields to the value field you are targetting (ie one relationship for each value you are counting)

3. Create a separate unstored calculation field for each relationship, with a formula along the lines of: Count(ValueCountOne::YourValueField)

These calculating fields will provide a dynamically updating 'read-out' of the number of each value in the database.

There are other methods and also numerous variations on each, but the above suggestions should give you some ideas to work with...

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.