5 Replies Latest reply on Apr 2, 2013 2:52 PM by philmodjunk

    Unique Groups of Records

    brodlang

      Title

      Unique Groups of Records

      Post

           Hi,  I have application where I need to add "preps" via a child table portal for the parent table records. The preps consist of 5 fields and typically each parent record will have 3 to 5 prep records (children) but theoretically could have any amout. Parent record B may or may not have the same preps as record A and so on.  However it is common that several parent records will have the same "group" of preps

           I'm trying to find a way to identify parents that have identical groups of prep records so that I can later consolidate the parents in a detailed sub-summary report.  Any ideas?

        • 1. Re: Unique Groups of Records
          philmodjunk

               List ( Preps::PrepType )

               If defined in the parent table, will produce a return separated list of PrepTypes from the related Preps table. If you specify a sort order in the relationship to Preps that sorts the Preps table by PrepType, the resulting value in this table will be identical for all parent records with the same selected set of preps records and thus you can sort on this calculation field to group your records by the preps records created for each parent record.

          • 2. Re: Unique Groups of Records
            brodlang

                 Sounds like what I'm looking for.  I assume this is a text field with calculated value, right?  I'll let you know how it works out, but it might take me awhile. Thanks again, Phil.

            • 3. Re: Unique Groups of Records
              philmodjunk

                   No. It would be an unstored calculation field with a tText result type. It won't sort quickly but it will sort.

                   If you find you need a faster sort, consider replacing it with a text field that is updated with a script using set field and the List function via each time records in Preps are added/deleted/changed.

              • 4. Re: Unique Groups of Records
                brodlang

                     Hi Phil,  I'm getting a list of the fields I need, but from the first related record only.  I need every related record included. Am I barking up the wrong tree with the List function or am I just doing it wrong?

                • 5. Re: Unique Groups of Records
                  philmodjunk

                       List will produce a "verticle" list. Each field's value will be on it's own line in the field. That what you get with a return separated list.

                       If you want to list all the members of the list in a horizontal list, put the List function inside substitute funciton like this:

                       Substitute ( List ( ChildTable::Field ) ; ¶ ; ", " )