4 Replies Latest reply on Mar 28, 2014 2:50 PM by mk4482

    Sort Calculated Field

    mk4482

      Title

      Sort Calculated Field

      Post

           I am using Filemaker 11 Advanced and have created a calculated field (called Building Room Combined) which combines the building name with the room number (Melrose 15, Graf 109).  It is also a "grouped" field in a report so it groups all inventory in a classroom.  In other words, the report lists Melrose 15 and all the inventory in it, and then Graf 109 and all the inventory in that room.  I want to sort on the combined field, but it is sorting on the classroom number (15, 109) - so Melrose 15 comes first and then comes Graf 109.  I want it to sort alpha so that Graf 109 comes before Melrose 15.  Both the separate building and room fields are text fields.

           In the calculated screen, I changed the calculated result to be text, but that messes up my grouping.  The only way the grouping continues to work is if the result is a number (which is probably why it sorts on that part of the calculated field).  I know I am missing something really simple - so how can I sort based on the building name in the combined field and not the classroom number?

           This is my calculated field: Building & " " & Room.

           Thanks!

        • 1. Re: Sort Calculated Field
          philmodjunk

               If you select number are your result type, you get sorting only by the numeric values in the combined field. If you select text as the result type, the system sorts by text sorting rules (alphabetical order).

               It would appear that neither option works for you. I would suggest that you not sort on either field, but sort on the separate building and room fields used in your calculation so that you can get both alphabetical and numeric sorting for your report.

          • 2. Re: Sort Calculated Field
            mk4482

                 Thanks for the reply.  I had to add those two fields (building and room) to the layout and then sort, but that worked.  I like View as List better than View as Table.  Is there a way to now hide these two fields in List View?  I know how to do it in Table View, but not List View.

                 Thanks!

            • 3. Re: Sort Calculated Field
              philmodjunk

                   You do not need to add a field to a layout in order to use it in a sort order.

              • 4. Re: Sort Calculated Field
                mk4482

                     How right you are.  Duh.