![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
If you try this and you like it, let me know, post back here, I'm interested in your comments or suggestions. 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 -Squeed |
ifferences; CF:
ifferences & "¶¶" & $$_A & "¶" &
#3
| |||
| |||
|
|
If you need to be able to identify duplicate records in your Filemaker database, read on, here is a simple way to accomplish this with 5minutes worth of work and all done within a script. One of the things that Filemaker Pro (all versions) is missing is agood duplicate record identification and removal/merger feature. I've seen a lot of posts here on how to identify and remove duplicates but they all seem very complicated and involve linking and alternate tables. I've figured out a way to create a simple duplicate tagging scriptthat you can use to identify duplcates in your Filemaker database. For this example, the database is called "DATA.fp7" and the script is called "Flag Dupes". This script determines what records areduplicate records based on records having an identical address. Again, this is a simple example, if you wanted to identify duplicate records based on more than just the value of one field, you couldmodify this method to use multiple fields, very easily. The database that I am using has the following fields : Contact Name, Address, City, State, ZIP and two fields that I created for the purpose of identifying duplicates. Those fields are"Duplicate" and "global". The global field needs to have a storage option of global. i.e. thesame value for every record in the database. The script is below. What isn't shown is what the sort option is. The sort option is "Address" because address is the field that I amsearching on for duplicates. The result of running this script will be that all records that are duplicates except for one unique of the duplicates will be marked "Dupe". After the script has been run, you need to do a search on"Dupe" and delete those found records. Here is how it works : The script starts by showing all records in the database, then sorts the records by address. It then begins to look through all of the addresses and where the address of a record equals the address of theprior record, that record gets flagged as a "Dupe". That's it. If you try this and you like it, let me know, post back here, I'minterested in your comments or suggestions. 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 ATA::global] Set Field [DATA: uplicate; "Dupe"]End If Copy [Select; DATA:Address] Paste [Select; DATA::global] End Loop -Squeed |
#4
| |||
| |||
|
|
In article 1181960625.962979.327180 (AT) q69g20...oglegroups.com>squeed2000@yahoo .com wrote: If you need to be able to identify duplicate records in your Filemaker database, read on, here is a simple way to accomplish this with 5minutes worth of work and all done within a script. One of the things that Filemaker Pro (all versions) is missing is agood duplicate record identification and removal/merger feature. I've seen a lot of posts here on how to identify and remove duplicates but they all seem very complicated and involve linking and alternate tables. I've figured out a way to create a simple duplicate tagging scriptthat you can use to identify duplcates in your Filemaker database. For this example, the database is called "DATA.fp7" and the script is called "Flag Dupes". This script determines what records areduplicate records based on records having an identical address. Again, this is a simple example, if you wanted to identify duplicate records based on more than just the value of one field, you couldmodify this method to use multiple fields, very easily. The database that I am using has the following fields : Contact Name, Address, City, State, ZIP and two fields that I created for the purpose of identifying duplicates. Those fields are"Duplicate" and "global". The global field needs to have a storage option of global. i.e. thesame value for every record in the database. The script is below. What isn't shown is what the sort option is. The sort option is "Address" because address is the field that I amsearching on for duplicates. The result of running this script will be that all records that are duplicates except for one unique of the duplicates will be marked "Dupe". After the script has been run, you need to do a search on"Dupe" and delete those found records. Here is how it works : The script starts by showing all records in the database, then sorts the records by address. It then begins to look through all of the addresses and where the address of a record equals the address of theprior record, that record gets flagged as a "Dupe". That's it. If you try this and you like it, let me know, post back here, I'minterested in your comments or suggestions. 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 ATA::global] Set Field [DATA: uplicate; "Dupe"]End If Copy [Select; DATA:Address] Paste [Select; DATA::global] End Loop -Squeed It really isn't necessary to sort and loop, so as to compare one record with the prior record. Please bear with me: it takes longer to explain the logic than to write the script itself: 1. Find all of the duplicate records based on whatever field or combination of fields you choose, as long as you're comfortable with the criteria that makes the record a duplicate. This is done simply by entering an exclamation point (!) in the field in Find Mode. 2. Trap for nothing in the found set. 3. Delete a record. Any record, it makes absolutely no difference which one. If it is a duplicate according to Step 1, you already know you don't want half of this pair. You'll still have another. 4. Do it again. Since we eliminated one record from a duplicate pair, the remaining record is no longer a duplicate, and will not be in the new found set. If there were more than two duplicates, the pair will be part of the found set, and one will be deleted. If no duplicates remain, the script stops. Thus, the entire process can be reduced to 6 steps. Let's call this script "Delete Dupes): Perform Find [ Specified Find Requests: Find Records; Criteria: YourTable::YourField: ?!? ] [ Restore ] If [ Get ( FoundCount ) = 0 ] Exit Script [ ] End If Delete Record/Request [ No dialog ] Perform Script [ ?Delete Dupes? ] If you prefer to execute the script just once, you can delete the last step and enclose the rest in a Loop. In my opinion, that doesn't serve much more purpose than to add another step. This obviously does not provide for a confirming examination of marked records after identifying them as duplicates. It does not allow for variations (e.g., misspellings or an abbreviation versus a spelled-out word), but then, neither does your script. It is workable (and recommended) only if you are 100% sure that there should not be more than one record in which the same information populates a particular field. I'm sure there are some who would consider this just a tad too "quick and dirty," but it works just fine for my purposes, and I doubt you'll find anything simpler. I am open to whatever criticism. Matt |
(
#5
| |||
| |||
|
|
In article <nemoMon061807023... (AT) news (DOT) verizon.net>, Matt WIlls I... (AT) Witz (DOT) End> wrote: In article 1181960625.962979.327... (AT) q69g2000hsb (DOT) googlegroups.com>squeed2000@yahoo .com wrote: If you need to be able to identify duplicate records in your Filemaker database, read on, here is a simple way to accomplish this with 5minutes worth of work and all done within a script. One of the things that Filemaker Pro (all versions) is missing is agood duplicate record identification and removal/merger feature. I've seen a lot of posts here on how to identify and remove duplicates but they all seem very complicated and involve linking and alternate tables. I've figured out a way to create a simple duplicate tagging scriptthat you can use to identify duplcates in your Filemaker database. For this example, the database is called "DATA.fp7" and the script is called "Flag Dupes". This script determines what records areduplicate records based on records having an identical address. Again, this is a simple example, if you wanted to identify duplicate records based on more than just the value of one field, you couldmodify this method to use multiple fields, very easily. The database that I am using has the following fields : Contact Name, Address, City, State, ZIP and two fields that I created for the purpose of identifying duplicates. Those fields are"Duplicate" and "global". The global field needs to have a storage option of global. i.e. thesame value for every record in the database. The script is below. What isn't shown is what the sort option is. The sort option is "Address" because address is the field that I amsearching on for duplicates. The result of running this script will be that all records that are duplicates except for one unique of the duplicates will be marked "Dupe". After the script has been run, you need to do a search on"Dupe" and delete those found records. Here is how it works : The script starts by showing all records in the database, then sorts the records by address. It then begins to look through all of the addresses and where the address of a record equals the address of theprior record, that record gets flagged as a "Dupe". That's it. If you try this and you like it, let me know, post back here, I'minterested in your comments or suggestions. 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 ATA::global] Set Field [DATA: uplicate; "Dupe"]End If Copy [Select; DATA:Address] Paste [Select; DATA::global] End Loop -Squeed It really isn't necessary to sort and loop, so as to compare one record with the prior record. Please bear with me: it takes longer to explain the logic than to write the script itself: 1. Find all of the duplicate records based on whatever field or combination of fields you choose, as long as you're comfortable with the criteria that makes the record a duplicate. This is done simply by entering an exclamation point (!) in the field in Find Mode. 2. Trap for nothing in the found set. 3. Delete a record. Any record, it makes absolutely no difference which one. If it is a duplicate according to Step 1, you already know you don't want half of this pair. You'll still have another. 4. Do it again. Since we eliminated one record from a duplicate pair, the remaining record is no longer a duplicate, and will not be in the new found set. If there were more than two duplicates, the pair will be part of the found set, and one will be deleted. If no duplicates remain, the script stops. Thus, the entire process can be reduced to 6 steps. Let's call this script "Delete Dupes): Perform Find [ Specified Find Requests: Find Records; Criteria: YourTable::YourField: ?!? ] [ Restore ] If [ Get ( FoundCount ) = 0 ] Exit Script [ ] End If Delete Record/Request [ No dialog ] Perform Script [ ?Delete Dupes? ] If you prefer to execute the script just once, you can delete the last step and enclose the rest in a Loop. In my opinion, that doesn't serve much more purpose than to add another step. This obviously does not provide for a confirming examination of marked records after identifying them as duplicates. It does not allow for variations (e.g., misspellings or an abbreviation versus a spelled-out word), but then, neither does your script. It is workable (and recommended) only if you are 100% sure that there should not be more than one record in which the same information populates a particular field. I'm sure there are some who would consider this just a tad too "quick and dirty," but it works just fine for my purposes, and I doubt you'll find anything simpler. I am open to whatever criticism. Matt The problem here is that you are deleting records, and the computer can never tell that they are definitely duplicates (depending on your data of course). You really need to mark them as "duplicate" and then have a human being go through making sure they are duplicates ... a long boring process, but then all data entry work is. ( |

#6
| |||
| |||
|
|
I'm sure there are some who would consider this just a tad too "quick and dirty," but it works just fine for my purposes, and I doubt you'll find anything simpler. I am open to whatever criticism. Matt |
#7
| |||
| |||
|
|
If you need to be able to identify duplicate records in your Filemaker database, read on, here is a simple way to accomplish this [...] |
#8
| |||
| |||
|
|
On Jun 15, 7:23 pm, squeed2... (AT) yahoo (DOT) com wrote: If you need to be able to identify duplicate records in your Filemaker database, read on, here is a simple way to accomplish this [...] That's pretty much how I do it. I've tried this and the "destructive loop" approach that is also mentioned in this thread. I don't really see much difference in the other method. Yours provides the opportunity for manual review, but the other is SLIGHTLY faster to implement. You might also want to consider that the duplicates are being treated as identical, but there could be other fields that don't match (say you're matching on address, but the phone number might be more up-to- date in another record). You might want to sort on the modification date (descending), so the last record modified is the one you keep and the others are marked as duplicates. |
![]() |
| Thread Tools | |
| Display Modes | |
| |