Jump 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 one record from a set of duplicates

Featured Replies

Hallo,

Here is the case.

From the point of view of one field in my database most of the records are duplicates. They are grouped in sets of records with the same value in this field.

I need to filter the records and display only one record (regardless which) having this value, but not to delete the rest. A script is to be used to automate the task.

Would you help me with this?

One way in a script:

Find duplicates using the !

Show all records

Omit record

show omitted only

So we found the dupes, and you are on the first found, then show all to clear omitted, then omitted the current, then show only that record.

  • Author

Thanks for the quick response, RodKp

Forgive me for not being specific enough.

I need not just one record representing all the duplicates, but one from each set of duplicate records.

Then you probably need to do something like this:

Create a field called marker

Find all duplicates

Sort by the field that is duplicated

Set a Variable or global field to the current name of the field

Loop thru the records and check the variable or global for a match to the field, if no match set marker to one and set the global to the new name and continue to loop thru the duplicates. Hope this makes sense. I'm about to call it a day or I'd put in script form for you.

See here for sample script

You are using FM7 though and variables do not exist so you would have to create a Global field and use that rather than what I used as my variable ($DupCheck).

  • Author

Thank you both RodKp and mr_vodka

As a newbie I'm supposed to read the FM Help more often. So I did it.

I solved my problem using the example in "Identifying duplicates using self joined table" to mark the first record in each duplicate set as Unique. In addition a find for the Unique records is performed. It works now.

I thank you for your effort. A community to rely on - it's a great feeling.

nena

  • 3 months later...

hi nena,

i was wondering if you could explain a little more clearly what exactly you did to mark the first record in the set of duplicates. i know how to search for unique records but am unsure about how to mark them as unique initially.

thanks

Lucas

Create an account or sign in to comment

Important Information

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

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.