3 Replies Latest reply on Jun 3, 2014 9:55 AM by martionmaggot

    How to sort alpha, when using List function

    vlight

      Title

      How to sort alpha, when using List function

      Post

           In FM11, when i use the List function, can i alphabetize the resulting list of values?  If so, how?  Right now, it's just giving me the list based on the order in which the values were chosen.

           specifically, i have a calc field where i am not only using the List function but also the substitute function on the list it creates, substituting the paragraph return for a dash (so i can see the list of values horizontally, as below... )

           Substitute ( List  ( TargetField ) ;  paragraph return character ;  "-" )      

           (Sorry, i'm on an iPad and couldnt actually type the pilcrow character in the calc above)

        • 1. Re: How to sort alpha, when using List function
          philmodjunk

               Don't you mean:

               Substitute ( List  ( RelatedTable::TargetField ) ;  ¶ ;  "-" )

               ???

               otherwise, there's no need for the List function here.

               assuming that you are listing values from a set of related records, you can define the desired sort order in the relationship to the related table. Then the list function will return the values from the related table sorted in the order specified by your relationship.

               If by anychance, you have a checkbox formatted field or other text field containing the list of values, the list function does nothing in your calcualtion. You may then want to replace this single field with a related table as that can make it easy to get your values sorted in the desired order.

          • 2. Re: How to sort alpha, when using List function
            kmsitall

                 I have a similar question about the sorting.

                 I'm using:

            Set Field [MainTable::Combine; List (RelatedTable::DesiredField)]

            to capture page numbers for an index. I checked and do have the portal sorting numerically from low to high, but the numbers are not following the order. I can see the portal as I work and they are definitely sorting.

                 See screenshot attached.

                 Thanks for any help!

            • 3. Re: How to sort alpha, when using List function

                   Try changing how the records are being sorted in the relationship.

                   File>Manage>Database & go to the Relationship Tab. Edit your relationship between your MainTable and your RelatedTable. On the right hand side below your RelatedTable check the box for "Sort Records" and select the field you want to sort by.

                   Hope this helps!