About formulas

Formulas perform specific operations on one or more values in a database file, and return a single result.

Formulas can be used to define:

Formulas can contain:

  • constants - numbers, text, date, or time values that don't change.

  • operators - symbols that indicate how to combine or compare two or more values.

  • functions - predefined, named formulas that perform specific calculations and return single, specific values for each repetition.

  • field references - fields in the same table or in a related table. A related field referenced in a calculation has the syntax tablename::related field. See Working with related tables.

If a formula can't be evaluated, it returns "?". To get an error code that indicates the cause of the problem, enclose the formula with the EvaluationError function.

Examples

Formulas can be used in many places throughout FileMaker Pro. Here are some examples:

  • Returns the first and last name separated by a space:

    Copy
    FirstName & " " & LastName

    For example, Michelle Cannon.

  • Returns the value in the SubTotal field multiplied by .08:

    Copy
    SubTotal * .08

  • Returns the first and last name, each on a separate line:

    Copy
    Field1 & ΒΆ & Field2

    For example,

    Fred
    Jane

Notes 

  • If you specify the context for a calculation, the calculation will be evaluated based on that context. Otherwise, it will be evaluated based on the context of the current window. See Specify Calculation dialog box.

  • If a calculation references a field the user does not have access to, due to permissions, the specified field and function reference is ignored.

    For example:

    Copy
    not IsEmpty ( userAccessible ) and not IsEmpty ( non_userAccessible )
    will evaluate to 1 (True), even though non_userAccessible field is not accessible to the user as long as userAccessible is not empty.