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.

Featured Replies

Hi All,

I'm very new to FMP, so please excuse me if this is a really simple question.

What I'm looking to do is have a field that displays a running count of the total number of times a value entered in another field within the same database.

Example: Field: Project Number - There will be multiple records within the same db

that contain this same number "1" ,"2", "3",etc.

Field: Project Count - This is the field that would have a running total of

number of time "1" appears in field "project number"

within the same db.

I hope the way I'm asking this makes sense. As I said I'm a total "newbie" to FMP, so please be gentle if I'm total missing the basics here.

TIA

Jamie Beedy

Create a self relationship (to the same file) with project number matching project number. Create a field:

ProjRecCount(calculation, number) = Count(ProjectNumber)

The Count function just count occurrences of a field with a valid value, beyond that it doesn't matter which field you "count".

-bd

  • Author

bd,

Thanks for the quick reply. I've tried what you suggested, But I'm getting an error message when I attempt to save the calculation- "either an operator was omitted, this function cannot be found, or "(" was not expected here".

I belive that I did everything you stated correctly. Have a field named "projectnumber" and defined a relationship from "projectnumber" to "projectnumber" within the same database. I then created a new field named "ProjRecCount" and made it a caculation and entered the calculation "ProjRecCount(calculation, number) = Count(ProjectNumber)". When I attempt to save this field, I'm getting the error listed above.

Again, I'm sure I'm missing something totaly basic here. So thanks again for any assitance you (or anyone else can provide) It is greatly apprecatied.

Jamie Beedy

In the window where you define the calculation, only enter the info on the right side of the equals sign.

Sorry for the shorthand and I did make one error. The Count function must reference a related field:

1) Define a calculated field with result type number.

2) Enter the following line into the calculation box:

Count(YourRelationshipNameHere::ProjectNumber)

Be sure to replace "YourRelationshipNameHere" with the actual name of the self relationship you created.

-bd

  • Author

bd-

First, no need to apologize for anything. I can't tell you how much I appreciate you taking the time to answer these questions.

I did as you said, and it does work, although there is one small problem. The first record of each unique number does not get a record number count.(I'm assuming because there are no records with that number to count.) And then all the following records of that number are one number too low in the count. I've add a "+1" to the end of the calculation, which gets the count to match the number of actual records, but the first record of each number still ends up with an empty field for the count.

One other thing. Is there a book you could possibly recomend that would have this kind of information. As you can tell, I'm brand new to all of this and even at this early stage of using FMP, I'm amazed at what it can do already, and I know I haven't even sctrached the surface.

Thansk again for all of your help

Jamie Beedy

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.