Jump to content

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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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

This topic is 7484 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.