2 Replies Latest reply on Aug 18, 2014 12:56 PM by cn2

    Finding average



      Finding average


           I have a student table related to a score table defined by a keyId field and subject field. In the score table each record is a score with type of test (example test or quiz).  I need an average that works by first averaging the (tests) and then (quizs) and then an average of the two. I can make it work like this (GetSummary ( SumAverageQuiz ; SumAverageQuiz ) + GetSummary ( SumAverageTest ; SumAverageTest )) / 2 , but this obviously doesn't work if one of these is blank. thanks for any help

        • 1. Re: Finding average

               As far as I can tell after a quick check in FileMaker help,

               GetSummary ( SummaryField ; SummaryField ) returns the same value as just referring to SummaryField in your calculation. It returns a "grand total" value.

               You can compute an average using:

               Let ( [ Q = SumAverageQuiz ;
                         T = SumAverageTest

                        Sum ( Q ; T ) / Count ( Q ; T )

               If there is some reason to use GetSummary instead of just the summary field for which I am unaware, replace the summary field names used here with GetSummary function calls.

               There are also a number of other ways to calculate these values using relationships or the ExecuteSQL function.

          • 2. Re: Finding average

                 Yes thats just what I needed Thanks