3 Replies Latest reply on Jul 30, 2009 10:54 AM by cdubbya

    Sorting repeating field - adapted Music Library template

    cdubbya

      Title

      Sorting repeating field - adapted Music Library template

      Post

      So, I'm using parts of the Music Library solution.  Let's say: 

       

      I have 40 gizmos (substituting the Album Title for the Gizmo Title)

      Each gizmo is changed or revised every week - Rev A, Rev B, Rev C, Rev D, Rev E, Rev F. 

      Someone will review the gizmos each week, and give each gizmo a star rating 1-5

      So, I have the star rating as a repeating field for the six Revs 

      However, 

      Not all 10 gizmos get reviewed each week. So in the fourth week, I could have a scenario like this: 

       

      Title       RevA  RevB  RevC  RevD

      Gizmo1  | ***  | **   |  *   |   *  |

      Gizmo2  | **    | **   |      |       | 

      Gizmo3  | ***  |*****|      |       | 

       

      I have a field,  CurrentRating which uses Last(star rating)   for each Gizmo.  Based on the data above, in the fourth week:

      Gizmo 1 would have a Current star rating of * 

      Gizmo 2 would have a Current star rating of **

      Gizmo 3 would have a Current star rating of *****

       

      Using the 'Record List' layout, the CurrentRating field does display the correct data, but when I click the sort field at the top, it doesn't sort correctly.  

      If you've worked with this starter solution, could you please help?   

       

      I guess what I'm really asking is:

      The script that sorts the records for Rating goes like this:

      If [Music Library::g_Sortby = 'rating1"]  

      Set Music Library::g_Sortby = 'rating2"]   

       

      Where do 'rating1' and rating2' come from?  How can i get these to work on my CurrentRating field, which looks up Last (Repeating Field)  

       

       

       

        • 1. Re: Sorting repeating field - adapted Music Library template
          TSGal

          Qappl:

           

          Thank you for your post.

           

          Looking over the Music Library quickly, I don't see any repeating fields, so you may have added that.  A repeating field is a single field that holds many values.  When you sort by a repeating field, only the first repeating value is used.

           

          "rating1" and "rating2" come from the global field g_Sortby.  If it is blank the first time, the ELSE portion of the script sets the value.

           

          Yes, you can also set this up for your CurrentRating field.  Just model a script after the SortTitle script, and attach a button to the column heading that executes the script.

           

          TSGal

          FileMaker, Inc. 

           

           

          • 2. Re: Sorting repeating field - adapted Music Library template
            comment_1
              

            TSGal wrote:
            Looking over the Music Library quickly, I don't see any repeating fields

            I am guessing Qappl is using version 9 or lower. Many (perhaps all) templates used repeating fields instead of a related table, causing endless frustration among beginners.


            • 3. Re: Sorting repeating field - adapted Music Library template
              cdubbya
                

              GREAT SUCCESS!!   I see where I was going wrong now.  Where you said "rating1" and "rating2" were determined by the ELSE statement in the script was the spark.  Basically, I thought I had set up my CurrentRating script the same... but I didn't see that rating2 could have the attribute of other field sorts within that same list view.  When I changed that, it all worked.  Thanks a bunch!  Now I won't get fired.  

              Maybe.  

               

              Aaaah, who cares? ; ) 

               

              BTW, using FMP 10.  

               

              Thanks again.