3 Replies Latest reply on Jun 4, 2014 3:37 PM by philmodjunk

    Summary percentage calculation error



      Summary percentage calculation error


           I have a summary calculation  -- a cost per click through rate. I have a report that summarizes by company. The calculation figure is correct for the grand total, but is wrong for each company. See attached.


        • 1. Re: Summary percentage calculation error

               I gather that CPC = Cost / Clicks

               What is each row in this screenshot?

               Is each row a record,  a set of fields, or a sub summary layout part?

               Is CPC a calculation field that refers to summary fields in the calculation? (If so, look up the GetSummary function in Filemaker Help.)

          • 2. Re: Summary percentage calculation error

                 Each row is a sub summary sorted by company. CPC = summary of costs / summary of clicks. Both of those summary fields are correct on the report, it is only the calculations that are incorrect, not just for CPC, but also for CTR (Click Through Rate = Clicks / Impressions). I created GetSummary of Clicks and GetSummary of Costs, then created a calculated field to divide GetSummary of Cost by GetSummary of Clicks, but it does not work. Plus, when I place the GetSummary fields on the report, no data shows up.

            • 3. Re: Summary percentage calculation error

                   GetSummary is the function that you need to use.

                   It has the syntax: GetSummary ( SummaryField ; BreakField )

                   "Break Field" should be the same field that you specify in the sub summary layout part as your "sorted by" field.

                   This will work as long as a) The current found set is still sorted on the break field and b) the break field is defined in the same table as the summary field.

                   Given your report that the calculation is coming up empty, you may be specifying a break field from a related table. That works for the sub summary layout part but not this function. In such cases, it is sometimes necessary to add an unstored calculation field that copies the break field value from the related table. You then use this calculation field as your break field and sort your found set of records by this unstored calculation field.