1 Reply Latest reply on Mar 15, 2011 9:33 AM by philmodjunk

    Help with a sum calculation

    kilbot

      Title

      Help with a sum calculation

      Post

      I have a field that if OWNER_ETHNICITY and OWNER_GENDER match a given criteria it gives a letter.

      Example

      Hispanic Male = "C"

      now I'm trying to create a summary calculation to count "C"s

      This is what I tried but does not work. Any suggestions?

      Sum (If ( ethnicity_gender_marker = "C" ; 1; 0 ) )

      Thanks

        • 1. Re: Help with a sum calculation
          philmodjunk

          You might check out the sum function in FileMaker help...

          Sum ( Field ) gives exactly the same result as just referring to Field.

          Sum adds up the values from a "list of fields" supplied to it as parameter(s).

          You can compute a sum such as: Sum ( field1 ; field2 ; field3 ; etc...)

          Or Sum ( repeatingField ) //sums up repetitions

          Or Sum (relatedtable::field ) , where it sums up the contents of field for all records related to the current record of the table where you defined the sum.

          From the syntax, it appears that ethnicity_gender_marker is defined in the same table as where you are computing this sum. If so, you might define a calculation field as If ( ethnicity_gender_marker = "C" ; 1; 0 ) set to return "number" as its return type and then define a summary field as the "total of" this calculation field. From a related table, you also have the option of computing this same total from the sum function.