1 2 Previous Next 17 Replies Latest reply on Oct 26, 2012 12:39 AM by BEFlynnPE

    Practical Applications of Repeating Fields

    BruceRobertson

      I would love to see an extended discussion of practical or innovative applications of repeating fields. And perhaps - other array concepts including repeating variables.

       

      There are good reasons NOT to use repeating fields and we need to accurately describe those limitations. I will reply to this message with another message addressing that subject. Then I'd like to post other replies (and solicit replies from others).

       

      What might "The Power User's Guide to FileMaker Repeating Fields" look like?

        • 1. Re: Practical Applications of Repeating Fields
          BruceRobertson

          When NOT to use repeating fields:

           

          Repeating fields are not a substitute for a properly normalized one-to-many design, commonly described as parent and child tables.

           

          In ancient history, repeats were FileMaker's first method of doing one-to-many (Invoices with line items, etc.)

           

          Later FileMaker versions moved on and added the notion of related tables. There are lots of advantages to a normalized design: you can easily sort, search, omit, print, select, import, export, individually delete child records.

           

          Sometimes users choose repeating fields because they don't know how to set up relationships. That's not what this is about.

           

          I want to begin by assuming that anybody commenting on this thread knows how to create a standard normalized design. They choose repeats to augment a normalized design because... (next)

          • 2. Re: Practical Applications of Repeating Fields
            beverly

            1. To find 'OR' results in a portal, a repeating field can be used. Each repeat becomes a "new request" in the portal.

             

            I'm not condoning or condemning the 'feature', just stating a little known function. Because finding by related fields results in the parent records in the found set, searching normally or with a repeating field may not produce what the user intended.

             

            There may be better ways to do OR searches inside the child records and then display and/or the parent records with Go To Related Records.

             

            The use of the repeating field in the portal row:

            • requires the field actually HAVE repeats by definition. The first repetition holds the data, but the other repetitions can be used to FIND

            • requires that the fields repeats be displayed on the layout within the portal row.

             

            Draw your own conclusions on this method. I have used it. I prefer not to use it.

             

             

             

            -- sent from my iPhone4 --

            Beverly Voth

            --

            • 3. Re: Practical Applications of Repeating Fields
              BruceRobertson

              What are some of the unique attributes of repeating fields?

               

              They allow "sparse" data population. You can put data into repeat 3, repeat 17, and repeat 200 and leave the in-between repeats empty.

               

              They are directly addressable: you can set or read Repfield[N].

               

              They allow fast easy lookups from other repeats.

               

              They can provide good methods for dealing with data that normally comes in standard groups; think of many calendar examples using repeats to represent months.

              • 4. Re: Practical Applications of Repeating Fields

                Attributes - ability to iterate, such as extending dates or any mathematical calculation for that matter, with $i using Get(CalculationRepetitionNumber), Middle() and so forth ...

                 

                My apology.  I should include examples - one of my favorites from Michael Horak:

                 

                Let ( [

                i = Get ( CalculationRepetitionNumber ) - 1 ;

                d = Extend ( ArrivalDate ) + i

                ] ;

                Case ( d ≤ Extend ( DepartureDate ) ; d )

                )

                 

                OR

                 

                GetValue ( List ( Child::Field ) ; Get ( CalculationRepetitionNumber ) )

                • 5. Re: Practical Applications of Repeating Fields

                  Flatlining lists into columns.

                  • 6. Re: Practical Applications of Repeating Fields
                    comment

                    Perhaps you should split this further into repeating data fields and repeating calculation fields.

                     

                    Repeating data fields can be useful for data sets that do not need to be further atomized. I have a few examples, but they are fairly atypical. Such as storing the settings of a 56-channel audio mixing board.

                     

                    Another use is as a substitute for a return-separated list (e.g. checkboxes). Here you get the advantage of data-typing: a list of dates is really a list of dates.

                     

                     

                    Repeating calculation fields are IMHO in another category altogether: they are one of the most powerful calculation tools out there - often better than a custom function or a looping script.

                    • 7. Re: Practical Applications of Repeating Fields

                      Michael Horak wrote:

                       

                      Repeating calculation fields are IMHO in another category altogether: they are one of the most powerful calculation tools out there - often better than a custom function or a looping script.

                       

                      Without question and I agree.  We could go days on calcs alone. 

                      • 8. Re: Practical Applications of Repeating Fields

                        Sparse population was mentioned, but I'll add that using repeating fields takes one of my solutions from about 100 Million records to approx 2 Million, making it more manageable.

                         

                        15 years ago this was necessary, although I must admit that because of the march of technology (hardware and software) the next rewrite will most likely not contain repeating fields in the same manner, but 100 million records may still pose some problems.

                        • 9. Re: Practical Applications of Repeating Fields
                          timwhisenant

                          Repeating fields type container,  great as UI storage, tool bars, toggle graphics (on/off), and other graphic objects.

                           

                          And of course, useful as vlists.

                           

                           

                           

                          Tim

                          • 10. Re: Practical Applications of Repeating Fields
                            DavidJondreau

                            I just used them as headers and data for cross-tab reporting, including having different values in the "headers" for different subsummary groups.

                             

                            It was the first time I'd used a Summary field on a repeater and it worked like a charm.

                            • 11. Re: Practical Applications of Repeating Fields
                              BruceRobertson

                              "Repeating calculation fields are IMHO in another category altogether: they are one of the most powerful calculation tools out there - often better than a custom function or a looping script."

                               

                              I  would really like to hear more about this, some examples?

                               

                              And in general, I'd like to encourage short descriptions of a few specific examples, where you (or anybody) feels free to mention them.

                              • 12. Re: Practical Applications of Repeating Fields
                                comment

                                There are so many I wouldn't know where to start... The main point has already been mentioned by LaRetta: a repeating calculation field has access to the iteration number, via Get (CalculationRepetitionNumber). It can also look at the result of another repetition - something you cannot do with a custom function (at least I don't think you can). And two repeating fields address corresponding repetitions, so you can perform true array operations.

                                • 13. Re: Practical Applications of Repeating Fields
                                  paulspafford

                                  I recently broke my cardinal rule of "Never use repeating fields to hold real (non-developer) data.

                                   

                                  A school was wanting their instructors to have a matrix for marking attendance in the classes. Each course only has a maximum of 14 classes. They wanted the dates as columns, and the students as rows. So I made a sixteen-repeat field (I never believe in the maximums users tell me) for each registration in that class. There is a boolean entry for present/absent in each repetition.

                                   

                                  They never want to do reports on the actual dates (e.g. How many students were absent on March 1?); they just want summary calcs (e.g. How many absences has this student had in this course?). It was the quickest, easiest way to set it up, and really had no down-side.

                                   

                                  That is, until they change their minds about reporting on individual dates. Could happen.

                                   

                                  Paul

                                   

                                   

                                   

                                  --

                                  Paul Spafford

                                  FileMaker Database Superhero,

                                  Spafford Data Solutions

                                   

                                  Tel: 613 838 9956

                                  www.paulspafford.com

                                  www.ottawafilemakerdeveloper.com

                                  www.fmlayoutmode.com

                                  www.fmscripts.com

                                   

                                  FileMaker User Group in Ottawa:

                                  www.meetup.com/fudgeo

                                  • 14. Re: Practical Applications of Repeating Fields
                                    BruceRobertson

                                    And of course, useful as vlists.

                                    Tim

                                    I am curious how you are using repeats with VLists (virtual lists).

                                     

                                    Lotsa ways to do it. A while ago I saw a great example by Steven Sanders of using one relationship to display a large number of portals with independent content.

                                    1 2 Previous Next