Jim_Shelton Posted January 18, 2008 Share Posted January 18, 2008 In FM 8.5, I need to sort all duplicates to the top, and yet show all records from an import. The records being imported have a control number that matches all duplicates. The ending result will be to export as a .txt file. I can show all duplicates, but how to I then have the non duplicates show at the below all the duplicates? thanks Jim Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted January 18, 2008 Share Posted January 18, 2008 Have an auto-enter text field with a value of g.GlobalField X. Set g.GlobalField X to Get(CurrenttimeStamp) just before you import. When you import, enable auto-enter options during the import process. Then do a Find for records that are duplicates, plus records where NewTextField = the value that's in g.GlobalField X. That ought to work, unless there's a reason that you don't want to enable auto-enter options during import. Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted January 18, 2008 Author Share Posted January 18, 2008 I do not mind enabling auto enter, but would that not give each record the same user stamp? When I tried it all records showed, but the duplicates were no longer separated as a group. Jim Quote Link to comment Share on other sites More sharing options...
mfif Posted January 19, 2008 Share Posted January 19, 2008 You say you have a control number that matches all duplicates. I assume it's a separate field. If that control number is a constant, you could sort by that field, specifying a value list that contains that constant and nothing else. However, you need the non-duplicates to be non-empty, or they will sort to the top. So you could add an auto-enter calc field definition that sets the field to "0" if it's empty. Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted January 19, 2008 Share Posted January 19, 2008 I do not mind enabling auto enter, but would that not give each record the same user stamp? When I tried it all records showed, but the duplicates were no longer separated as a group. Jim If the duplicates are in the system FIRST and THEN you import the other records, the duplicates should be at the TOP of the final found set. If you mean that some of the duplicates will be among the imported records, that's a different story, but that's not what I understood you to be saying. Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted January 21, 2008 Author Share Posted January 21, 2008 Hunter sorry for any miss guidance. The dupes already exists in the file to be imported. (They are necessary for another process.) I created a new field that does receive a time/date stamp. I do a find, replace contents of the date stamp then show all records, then sort. Multiples come to the top. May not be pretty, but I got it there. Jim Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted January 21, 2008 Share Posted January 21, 2008 Dont' import that file. Use this technique instead. That thread pertains to how to do it in FileMaker 4, but the underying approach is still entirely applicable. If you have some friction trying to find the modern script step equivalents to FileMaker 4 commands, just ask. (At casual glance, none of the ones used there have changed, though). In short, instead of importing, loop through the record set you were going to import, and do a series of Set Fields via a relationship that allows for the creation of related records. When you come to a rec that's already been included, it won't create a new rec, it will just rewrite the field values in the existing record. You'll end up with one copy each of each unique value. Quote Link to comment Share on other sites More sharing options...
Jim_Shelton Posted January 23, 2008 Author Share Posted January 23, 2008 Thanks Hunter, the process makes more sense. Jim Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.