6 Replies Latest reply on Jan 29, 2014 8:42 AM by philmodjunk

    Descending Value List sort



      Descending Value List sort


           I have a value list that displays two fields, the first is the primary key, and the second is a description.  I see on the VL that I can sort by field 1 or 2, but I want to VL to sort descending by the PK field (field1), this way the latest entry or highest number is always at the top of the list.

           Can this be accomplished?



        • 1. Re: Descending Value List sort

               For a two field value list, ascending order is the only available option. This is one of the more irritating limitations of the FileMaker system.

          • 2. Re: Descending Value List sort

                 Bummer, is it possible then to make a PK auto enter field count down.  For example I change the beginning number each year so it includes the year.  For instance this year I started my PK field at 2014001, and it increments by 1.  Could I say start at 2014999 and decrement by 1?  This would keep the latest entries at the top of the list.


            • 3. Re: Descending Value List sort

                   Such an "encoded meaning" (the year) field should not be your PK in the first place.

                   But what you describe would work--but only if you show both fields in your value list. If you hide the PK field, the value list will not sort on it.

              • 4. Re: Descending Value List sort

                     Thank you, I realize the PK field set up is not best practice.  I am working on getting rid of that schema by creating a "Date Created" field and have the date/time auto entered on record creating.

                • 5. Re: Descending Value List sort

                       The auto-Enter Increment by will not allow a negative value.  Is the best way to handle this to create a number field in the table, then on record creation decrease that value by one.  Then I can use the calculated value in the Auto-Enter section?

                       Or create a globals table with a number value field that decreases and set the PK value = to that global table field.

                       Or Is there a better way?


                  • 6. Re: Descending Value List sort

                         Will that even work for you given the limitations of a FileMaker Value list? (You have to keep that first field visible if you are going to sort on it.)

                         The danger to not using an auto-entered serial number of Get (UUID) for you unique identifier is that other methods can result in duplicate values if you have more than one person creating new records in this table at the same time.

                         You might want to auto-enter a serial number and then use a calculation that subtracts the serial number value from a very large integer to get the needed order.