Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Sorting


BigFat
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use