Reputation: 375455
I have a Filemaker table with multiple entries in fieldA
, how can I set fieldB
to count the number of occurrences of the corresponding number of records which have the same value in fieldA
.
For example, if fieldA
is a;b;b;c I want fieldB
to read 1;2;2;1.
Upvotes: 0
Views: 2712
Reputation: 10714
You'll want a recursive custom function which you pass the fieldA contents in to.
It takes as parameters:
grab the fieldA value (e.g. "a") at the supplied position, then count the number of occurrences of "a" in the text being parsed. Append this to the output text, then if there are more values to process, call the recursive function again, with an incremented position, returning the result. Otherwise, return the output text.
Upvotes: 0
Reputation: 2669
The simplest is to make a self-relationship from the table to another occurrence of the same table by fieldA
. Then fieldB
can be like Count( sameFieldA::fieldA )
.
Upvotes: 1