12 Replies Latest reply on Dec 21, 2009 4:20 PM by RCaauwe

# Summary count of duplicate numbers..

### Title

Summary count of duplicate numbers..

### Post

I have a layout report that shows a list of N Numbers.  Many of these are duplicates (which is normal).  They are sorted in N Number order, so the duplicates are together.  I want to know the total number of unique N Numbers there are.  In other words I want a count of the groups of N Numbers, not how many are in each group.

Example:  If my list looked like this:

N123

N123

N567

N678

N999

N999

N999

The summary count I would want to see is:  4

• ###### 1. Re: Summary count of duplicate numbers..

Howdy,

RCaauwe wrote:

Example:  If my list looked like this:

N123

N123

N567

N678

N999

N999

N999

The summary count I would want to see is:  4

Did you mean 3 ?  or 5 ?  There are five numbers which are duplicates (N999, N999, N999, N123, N123)...or three repeats of originals.  I can't make out how to get 4.
• ###### 2. Re: Summary count of duplicate numbers..

I guess I didn't make myself clear enough.  These represent the registration numbers of some aircraft.  I want to show a total of how many aircraft are represented in the list (The actual list has over 500 entries).  So:

N123 is listed twice  - counts as 1

N567 is listed once  -  counts as 1

N678 is listed once  - counts as 1

N999 is listed three times - counts as 1

TOTAL COUNT = 4

• ###### 3. Re: Summary count of duplicate numbers..

So you are counting Unique values rather than the duplicates :smileywink:

Comment once posted the following link to another Filemaker forum that discusses this. If you follow the links, you'll find two methods described for doing this:

http://www.fmforums.com/forum/showtopic.php?tid/212312/#345628

• ###### 4. Re: Summary count of duplicate numbers..

Howdy,

My bad.  You did say you wanted the number of unique numbers in the text of your post.  The title put me in the wrong frame of reference and I passed right over it.  Sorry.

• ###### 5. Re: Summary count of duplicate numbers..
I'm thinking possibly adding a script step "Open Manage Value List".  I haven't used this one yet, but maybe it's the first step in letting the script build a value list, and then count the number of records (unique values) in it.  Sound like a possibility?
• ###### 6. Re: Summary count of duplicate numbers..
Not really, You'd set this value list up once by hand and then use a calculation (in a script or a field) to count the values. Note that this method counts all the values in the table, not all the values in your found set.
• ###### 7. Re: Summary count of duplicate numbers..
Well, I guess I'm back to square one then.  This shouldn't be this difficult.  Maybe it's going to take a Loop where you read through the file and add 1 to a counter when the N Number changes.
• ###### 8. Re: Summary count of duplicate numbers..

If I may presume Phil's intent with the link he posted, it was to have you look at this approach that comment had posted:

http://fmforums.com/forum/showtopic.php?tid/196904/#297916

It was the second link up the chain...

• ###### 9. Re: Summary count of duplicate numbers..

A good presumption.

I couldn't tell for sure which method would be best from the posts in the thread at the time I suggested it. The value list trick is simple and easy to set up, but limited in ways the "reciprocal summary" method is not.

• ###### 10. Re: Summary count of duplicate numbers..
I had looked at it, but decided it was too obscure for me to understand..  On second look, I understand what they are doing and not as complicated as I thought.  So....I'll give that a try.  Clever idea.
• ###### 11. Re: Summary count of duplicate numbers..

The value list method also seems pretty slick, basing a value list on the field and thus stripping duplicates as a side effect.  Then counting the value list items.

For some reason I have an inherent dislike of using side effects, but have no defensible stance on it.  It shows a great understanding of FMP's quirks and how to use them to advantage.

• ###### 12. Re: Summary count of duplicate numbers..
I used the method of dividing the summary count of records in a group into 1 and then count all the fractions.  It works great.  Thanks for the tip.