Jump to content

This topic is 8264 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 8264 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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