BigFat Posted April 27, 2006 Share Posted April 27, 2006 Hi I am creating a small customer db using FM Pro 7. I want to make a number field for each customer. I am using this number to sort. The lower number i give the closer (driving distance) this customer is to my office. So i have now 50 customers "ranking" from 1 to 50. But now i get a customer that should rank in between 3 and 4. Can i create a new record with the rank no. 4 and have filemaker correct the ranking from 4 to 50( old 4 is now 5 and so on) I hope i make myself clears Thanks BigFat Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted April 27, 2006 Share Posted April 27, 2006 hi, yes, you can do this: 1-perform the sort by driving distance 2-put cursor in the ranking field of the first record (i.e. the shortest distance) 3-menu->records->replace field contents, replace by serial. this procedure can be scripted maarten Quote Link to comment Share on other sites More sharing options...
LaRetta Posted April 30, 2006 Share Posted April 30, 2006 kjoe, BigFat didn't indicate that he had a Distance field, that I can tell ... if he had a distance field, would he even need the number field? I want to make a number field for each customer. I am using this number to sort. The lower number i give the closer (driving distance) this customer is to my office. Hi BigFat, If you do this, you will have to renumberize every Customer record every time you add a customer. YUK. When you add a Customer, instead of entering THIS number, why not enter your one-way miles? Then whenever you wish to see them in order of driving distance, just simply sort them. It would be much quicker - no resetting the number field at all ... and certainly more efficient. smiley-laughing LaRetta Quote Link to comment Share on other sites More sharing options...
Maarten Witberg Posted April 30, 2006 Share Posted April 30, 2006 LaRetta, I had given that some thought. But if the number of customers increased, then it would become harder and harder to pick a distance ranking. So I assumed the existence of a distance field, possibly wrongly I admit, but it would allow the user to let filemaker do the sorting for him, as you pointed out also. I guess I should have pointed out that I assumed this field was there. Nevertheless, I don't agree that a ranking field is unnecessary. Because for instance if you've done a find on some criterion and you get two contacts, then knowing two distances, say ten and fifteen kilometers, does not tell you much about their relative ranking. There may be two contacts inbetween, or twenty, or none at all. So I'd still go for the renumbering of records. Which is not that big a deal I think. What may be an issue is that straightforward renumbering will give you a ranking even of equal distances. Maarten Quote Link to comment Share on other sites More sharing options...
BigFat Posted May 1, 2006 Author Share Posted May 1, 2006 Hi Guys I made my numer field and then i made a small script that sort all records by that number. Then the script will add 1 (one) to all records with a higher number than the record i want to change. Thanks for your help it always makes it easier when you can discuss it so thanks again 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.