stann Posted August 3, 2004 Posted August 3, 2004 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
-Queue- Posted August 3, 2004 Posted August 3, 2004 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.
stann Posted August 3, 2004 Author Posted August 3, 2004 Thanks for the answer. But can you explain the second Calculation. I just don't understand what you mean.
stann Posted August 3, 2004 Author Posted August 3, 2004 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
-Queue- Posted August 3, 2004 Posted August 3, 2004 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.
normdouglas Posted August 5, 2004 Posted August 5, 2004 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now