Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Finding and deleting duplicate records

Featured Replies

Hi I had a beautiful DB with about 6000 records and someone imported about 4000 duplicate records that I need to get rid of.

I need to write a script (i think) to lookup the duplicates and then delete them

Can someone give me some clues? Thanks

Clues? The FMP 5.5 Users Guide (which you can download from their site) uses that problem as their example script, pages 10-13 to 10-15.

P.S. Was the pun of the duplicate note intended? wink.gif

P.P.S. Actually, its an example of the hard part of duplicate records... when they're logically duplicates, but not textually duplicates! smile.gif

  • Author

No duplicate intended, I thought I had stopped the post in time to correct a spelling error, but embarrassingly not

I'll get hold of the manual and have a look when I get home and see how I go.

Thanks

This one should be fairly easy. If the duplicate records were all imported at one time, they will be consecutive records when the file is unsorted. So, just Show All, select the first duplicate, Omit Multiple for the number of records imported, Show Omitted, and delete the found set. Much easier that finding duplicates scattered all through the file. This is one reason I always include fields for creation date, creation time, modification date and modification time in every file (although in this case import can fool them).

-bd

  • 2 weeks later...
  • Author

Thanks, the first thing I thought was 'script', but I'll give it a go and look at the number order of the added records.

  • Author

If you still want to use a scripted approach, you may wish to have a look at the file which can be downloaded from the following URL:

http://www.nightwing.com.au/FileMaker/demos/FindUnique.fp5

The technique shown in the file extracts a found set of records which include only one occurrence of a given value in a specified field. If you apply the technique to a field which identifies the duplicates (eg an ID field) and add the following two steps:

Show Omitted

Delete All Records [No Dialog]

Then the second and subsequent versions of any records will be deleted, retaining only the first occurrence of each record.

If you include a secondary sort key (reverse by recordID) in the sort parameters for the script, the result will be instead to retain only the most recently added occurrence of each record. Similarly, a second-key reverse sort on a modification date/time field would retain only the most recently edited copy of each record.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.