![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Show All Records Sort Records [Restore; No dialog] Go to Record/Request/Page [First] Copy [Select; DATA::Address] Paste [Select; DATA::global] Loop Go to Record/Request/Page [Next; Exit after last] If [DATA::Address = DATA::global] Set Field [DATA: uplicate; "Dupe"]End If Copy [Select; DATA:Address] Paste [Select; DATA::global] End Loop |
#3
| |||
| |||
|
|
There's no real problems with this script and it should work fine as is, but there are a few suggestions I can think of to make the script run faster when processing lOTS of records or on a slow computer / network. First, don't bother with Copy and Paste - it's a waste of time since the If command won't test for changes in font, colour, etc. and means the Global field needs to be on the current layout. Instead use a single Set Field command. The If test inside the Loop could do with an Else command. Instead of changing the content of Global on every record, just change it when the Address changes. Lastly a Freeze Window command would mean that FileMaker doesn't have to keep updating the display each time it moves to the next record. The window will automatically unfreeze when the script ends. That would give you a script something like ... Show All Records Sort Records [ Restore, No Dialog] Go To Record/Request/Page [First] Set Field [Global, Address] Freeze Window Loop Go To Record/Request/Page [Next, Exit After last] If [Address = Global] Set Field [Duplicate, "Dupe"] Else Set Field [Global, Address] End If End Loop Of course, you could cut down the number of records the script has to process by letting FileMaker find the duplicates first using the "!" symbol. Adding a little error capture for when there are no duplicates, you get something like ... Enter Find Mode [] Set Field [Address, "!"] Set Error Capture [On] Perform Find [] Sort Records [ Restore, No Dialog] Go To Record/Request/Page [First] If [Status(CurrentFoundCount) = 0] <--- see note below Message ["There are no duplicates"] Else Freeze Window Set Field [Global, Address] Loop Go To Record/Request/Page [Next, Exit After last] If [Address = Global] Set Field [Duplicate, "Dupe"] Else Set Field [Global, Address] End If End Loop End If Note: The Status(CurrentFoundCount) function is for older versions of FileMaker. For newer versions it has probably been changed to Get(CurrentFoundCount). Finding duplicates is never going to be easy. |
#4
| |||
| |||
|
|
Finding duplicates is never going to be easy. There are no problems in itself with this solution. But there is no way the solution can test on East Fifth Street and E5th st. In other words spelling differences or spelling mistakes will never, ever be found. I in my experience there will allways be some (or even many) records that should be trapped but simply aren't. So after such a script that finds all duplicate addresses you may also try duplicate posat codes (zipcodes) and mark these as to be reviewed. You will find false marked records, since postalcodes may be shared. But at least you might get rid of some more double records. As said: it is never going to be straight forward. Keep well, Ursus |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |