Deleting FileMaker Duplicate Records Via A Looping Script

From Dwayne Wright PMP - Certified FileMaker Developer
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

An age old question that keeps floating around is "How to delete duplicates but leave the originals intact?" There are a number of ways to do this but this technique has been around for a very long time. I have no idea where I first saw it.

Basically it consists of a combination of a FIND BY SYMBOL (duplicates in designated field), SORT (by designated field), LOOP (mark every occurrence of the duplicate except the original, FIND (marked records), DELETE (found set) and finally (SHOW ALL).

To best illustrate how this is done, I've created a small zip code example database file. From a text file, I have a collection of zip codes from a marketing database for the Chicago area. What I want now is a listing of each unique zip code so that I can target market specific areas of the city. So what I want at the end is a listing of each unique zip code string but delete the redundant duplicates.

So in the "Dup Example" folder , you will find each of the described section in an individual script. There is one master script called " DELETE DUPLICATES MASTER", that will call each of the scripts in order.

An example file can be downloaded by clicking here.

More info about the author and FileMaker in general, contact me at

© 2010 - Dwayne Wright -

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc