11 Replies Latest reply on Nov 8, 2012 1:52 PM by philmodjunk

    subsummary not totaling correctly

    kluetkenhoelter

      Title

      subsummary not totaling correctly

      Post

           Can anyone tell my why my sub-summaries are only giving me the total of the last (or first) item in a list of items based on if I a using a trailing or leading subsummary total?  I can not find anything that would be causing it to do this..

           I'd appreciate any guidance on things to look at, because so far, everything I've checked, seems to be set correctly.

           Thanks

        • 1. Re: subsummary not totaling correctly
          schamblee

               What field do you have in your sub-summary?  You need a summary field. 

          • 2. Re: subsummary not totaling correctly
            kluetkenhoelter

                 Unfortunately, the field is set up as a summary field, but it is not summarizing.  I've attached screen shots.  Maybe someone can see something that I am missing

            • 3. Re: subsummary not totaling correctly
              kluetkenhoelter
              /files/715a98e8d6/0001Ne.png 1280x989
              • 4. Re: subsummary not totaling correctly
                kluetkenhoelter
                /files/bcaecd585d/0002gu.png 1280x989
                • 5. Re: subsummary not totaling correctly
                  kluetkenhoelter
                  /files/1835d0347c/0003Lq.png 1280x989
                  • 6. Re: subsummary not totaling correctly
                    kluetkenhoelter
                    /files/cbbc493102/0004vN.png 1280x989
                    • 7. Re: subsummary not totaling correctly
                      philmodjunk

                           What is the "when sorted by"  field (also called the "break" field) you have selected for your sub summary layout part?

                      • 8. Re: subsummary not totaling correctly
                        kluetkenhoelter

                             by client

                              

                        • 9. Re: subsummary not totaling correctly
                          philmodjunk

                               Your layout is based on a table occurrence named "Jobs". Your summary field is defined in a data source table named Actuals 2012. I would assume that Jobs--the name of a "box" found in Manage | Database | Fields is not an occurrence of Actuals 2012. Thus, the total returned by the summary field is not based on the found set nor the groups produced by sorting by Client Name. When you refer to a summary field from a related table, it produces a summary value based on the set of related records instead.

                          • 10. Re: subsummary not totaling correctly
                            kluetkenhoelter

                                 Jobs is in Actual 2012.  Infact the two tables are linked by the the Jobs field

                            • 11. Re: subsummary not totaling correctly
                              philmodjunk

                                   That doesn't change what I said.

                                   You have a table occurrence named "jobs". If a summary field is referenced in the layout's table occurrence (The name specified in layout setup | Show Records from), the current found set or (if placed in a sub summary part) a sorted sub group of these records is used to compute the value shown in the summary field. If you refer to a summary field from another table occurrence than the layout's, the relationship between the layout's table occurrence and the summary field's table occurrence determine which records "match" to the current record on your layout. This set of matching records is then used to coompute the summary value.

                                   Here's a run down on how "context" controls how a summary field evaluates:

                                   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.