Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6356 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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).

Posted

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...
Posted

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

This topic is 6356 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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