animation_master Posted February 24, 2010 Posted February 24, 2010 This script deletes duplicates... except if the duplicates are the last records in the table. If the last "Go to Record" step is inside the "If" statement, this script deletes all of the last records. If the last "Go to Record" step is outside the "If" statement, it leaves one duplicate! Neither outcome is good. Any ideas? Delete Duplicates Sort Records [ Restore; No dialog ] Go to Record/Request/Page [ First ] Set Variable [ $ID; Value:Table01::ID ] Go to Record/Request/Page [ Next ] Loop If [ Table01::ID = $ID ] Delete Record/Request [ No dialog ] Else Set Variable [ $ID; Value:Table01::ID ] End If Go to Record/Request/Page [ Next; Exit after last ] End Loop
bruceR Posted February 24, 2010 Posted February 24, 2010 (edited) Sort Records [ Restore; No dialog ] Go to Record/Request/Page [ First ] Loop If [ Table01::ID = getNthRecord( Table01::ID; get( recordNumber) -1) ] Delete Record/Request [ No dialog ] Go to Record/Request/Page [ Previous; NOT Exit after last] End If Go to Record/Request/Page [ Next; Exit after last ] End Loop Delete.fp7.zip Edited February 24, 2010 by Guest
Søren Dyhr Posted February 24, 2010 Posted February 24, 2010 The looping could be completely avoided or rather substituted with a recursive script.... but the efficiency of the algorithm largely depends on the degree of contamination. --sd Delete_sd.zip
animation_master Posted February 24, 2010 Author Posted February 24, 2010 You're right! I forgot all about "nth record". Thanks again.
Recommended Posts
This topic is 5386 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 accountSign in
Already have an account? Sign in here.
Sign In Now