3 Replies Latest reply on Dec 23, 2012 11:52 PM by philmodjunk

    Why are Summary fields...fields?

    daverd

      Title

      Why are Summary fields...fields?

      Post

           Can someone explain why a Summary field is a field - as opposed to a Layout control?

           Why is a value that is not reflective to a specific record a field for that record?

           It seems to me that a Summary field holds a temporary value depending upon a Layout's definition.

           Am I missing something?

        • 1. Re: Why are Summary fields...fields?
          davidanders

               Fields hold data, fields can hold data and not appear on any layout.

               A single report can have hundreds of summary fields.

          • 2. Re: Why are Summary fields...fields?
            daverd

                 I understand what you are saying.  However, my point is that I think of fields as being relavent to a specific record.  Summary fields, as far as I see, do not fit this paradigm.  Their content is not associated with a specific record but to a group of records - where "group" is dependent on the Layout using that Summary field.  On top of that, one Summary field can be used on different Layouts to hold a different value or used multiple times on the same Layout - again, holding different values.

                 All this as opposed to having a Summary control - which would be associated with the Layout and not a record in a table.

                 Which leads me to ask, why is a Summary field a field?

            • 3. Re: Why are Summary fields...fields?
              philmodjunk

                   Asking fellow users why an application is designed a certain way isn't likely to get a satisfactory answer. You'd really need to ask the software engineers who originally designed FileMaker quite a few years ago.

                   But here's a summary of information on how summary fields can be used to produce an aggregate value. Not all of them depend on a layout design:

                   A "non Running" Summary field produces an aggregate value (a value from more than one field in one record). The value returned is determined by the context in which it is used/displayed:

              Summary field is referenced on a layout based on the table in which it was defined:

              A group within a FoundSet

                   If you place the summary field in a subsummary part that specifies the "break" field that grouped the records when the found set was sorted, you get a subtotal--the total for that group.

                   In a calculation, you can use the getSummary function to access the same group based sub total.

              All the records in a FoundSet

                   If you put that summary field in a layout part other than the sub summary part, you get the total for all the records in the current found set.

                   If you refer to a summary field in a calculation field defined in the same table as the summary field, it will also return a total for the current found set. (Which is why we have the GetSummary function to get sub totals in calculations.)

              Summary field is referenced on a layout based on a table related to the table in which it was defined:

              Not in a Filtered Portal

                   If you place the summary field on a layout based on a related table or refer to it in a calculation defined in a related table, the relationship controls the value that is computed. It will be based on all the records in the summary field's table that are related to the current record in this table.

                   Think of it this way, if you put a portal on this layout to the summary field's table, you'd see all the records in this portal that are used to compute the summary field's value in this context.

              In a Filtered Portal (FileMaker 11 and newer only)

                   If you place that summary field inside a portal with a filter, you no longer get a value based on all the related records. Instead, you see a value based on all related records for which the filter expression evaluates as True.

                   This is a special case use of a summary field that is often implemented by putting a single row copy of a filtered portal below it with the summary field inside so that the user sees a value based on just the records visible in the larger portal.

                   This is a "Display Only" trick as you cannot refer to the value of this field in a calculation and get the same value shown on the layout--you get the result described in "Not in a Filtered Portal" above.

                   Note that this does not just apply to "total" summary fields, Average, Count, Maximum, standard deviation, etc all follow these same rules.