1 Reply Latest reply on Apr 28, 2009 9:47 AM by philmodjunk

    renumbering ranking field

    msoule12

      Title

      renumbering ranking field

      Post

      I have a database that has a field with a dropdown list that has a list from 1-25. As the users' add new records, they prioritize the record using the dropdown list. They highest priority is 1, the lowest 25. If there are 2 records with the same priority ranking, for instance 4, the newest one is now ranked 4, the old 4 becomes 5, and the rest of the numbers become become the next number higher. How do I accomplish this? Is it a calculated replace after a sort, or a script that's run? We're using FMPro 9, not 10, so action scripts are not an option.

       

      Thanks in advance for any help.

        • 1. Re: renumbering ranking field
          philmodjunk
            

          Yes, you'll need a script. Your script may or may not use a calculated replace. Given how you want to handle duplicate values, you'll probably need to sort the records and then loop through each record updating their rank values.

           

          There are details not described in your post:

          If the ranks are:

           

          1, 2, 4, 5, 5, 6, 9

           

          Do you want

           

          1, 2, 4, 5, 6, 7, 9

           

          or

           

          1, 2, 3, 4, 5, 6, 7

           

          Or something else?