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.

How to find "non-concurrent" duplicate records..

Featured Replies

Call me dense, but it seems to me that most of the "find duplicate" scripts I've seen posted (as well as in the FM Pro 5 User's Guide - see pg 10-13 ) really only find duplicates which are next to each other, i.e., concurrent duplicates.

Right now, I'm trying to write a script which will find all duplicates (regardless of whether they're concurrent or not) and show them in a layout. In my case, the unique field is a calculation field and thus I cannot simply enforce it's being unique (like you can with a simple text or number field).

I'm using the "create a Mark and Global field" approach used in the User's Guide modified to also find non-concurrent duplicates. Here's what I have so far:

Show All Records

Sort[Restore,No dialog]

Go to Record/Request/Page [First]

#Get first UniqueID to search remaining records for

Set Field ["global", "MyUniqueID"]

Loop -----#this is the outer loop

Go to Record/Request/Page [Next]

Loop ----#this is the inner loop

If ["global = MyUniqueID"]

Set Field ["Mark", ""x""]

End if

Go to Record/Request/Page [Exit after last, Next]

End Loop

#go to the next record in the outer loop

Go to Record/Request/Page [Exit after last, Next]

#Get the next UniqueID to search for

Set Field ["global", "MyUniqueID"]

End Loop

Perform Find[Restore]

The intended logic is pretty clear. Go to the first record, get the UniqueID, and then loop thru all the rest of the records marking any records that have the same Unique ID. Then exit the loop, and go to the second record, get the UniqueID and then loop thru all the rest of the records marking any records that have the same Unique ID. It should be pretty clear that by doing this, by the conclusion of the script all duplicate records will be marked.

However, this script doesn't work. The problem appears to be that the outer loop does not retain it's position in the recordset when the inner loop exits,..i.e., where it says above "#go to the next record in the outer loop", well,..it doesn't,..rather, the outer loop is positioned where the inner loop exited,..i.e., at the end of the recordset.

Any suggestions on how to maintain the recordset position in the outerloop??? or,..any idea on how I could modify the "finding duplicate records" script in the User's Guide to also find non-concurrent duplicates??

Thanks

Unless I'm missing something, you are making things very difficult, not to mention slow. If you sort your file on the field that contains the duplicates, then the duplicates WILL be concurrent. Then you can use the example given on page 10-13 in the manual.

Using that Bob way 8 years without problem smile.gif" border="0

  • Author

Thanks Bob,

You weren't missing anything! Guess I was dense! Thanks again for your time in telling me the obvious!!

Dave

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.