Defining calculation fields
Use calculation fields to perform calculations on the following types of data: text, number, date, time, or container.
The data in a calculation field is the result of a formula that you specify. The result can be one of these types of data: text, number, date, time, or container.
To define calculation fields:
1.
With the database open, choose File menu > Manage > Database.
2.
3.
4.
For Field Name, type a name for the field.
See About naming fields.
5.
For Type, select Calculation.
6.
Click Create.
You see the Specify Calculation dialog box.
7.
If necessary, for Evaluate this calculation from the context of, choose a table from the list.
Setting the context for a calculation is only necessary when you're creating a calculation field in a source table that has two or more occurrences in the relationships graph. The choice you make may affect the calculation results, particularly if your calculation will include fields in related tables. See Choosing the evaluation context for a calculation field.
8.
Click where you want the item to appear in the formula box, then do the following. (You can also type the formula into the box.)
 
For Operators, click a button or type an operator. See Mathematical operators and Text operators.
For Operators, double-click an operator in the list or type an operator. See Comparison operators and Logical operators.
Constant value
To quickly build a formula:
 •
 •
 •
9.
 
Choose a data type for Calculation result is <value>.
Select Number of repetitions, then type the number of repetitions. See Defining repeating fields.
Select Do not evaluate if all referenced fields are empty.
10.
To select indexing and storage options for the field, click Storage Options, select options in the Storage Options dialog box, then click OK.
See Defining field indexing options and Defining global fields (fields with global storage).
11.
Click OK to close the Specify Calculation dialog box.
12.
Important  To avoid confusion when using dates in FileMaker Pro, always define calculation formulas to enter four-digit years. For information on how FileMaker Pro handles dates with two-digit years, see Conversion of dates with two-digit years.
To define calculation fields in Table View:
1.
2.
Click + in the column heading to add a new field.
3.
Right-click the column heading for the new field, then choose Field > Field Type > Calculation from the shortcut menu.
4.
Notes
 •
 •
 •
 •
 •
To include literal quotation marks in a calculation text string, precede the quotation mark character with a backslash character (/). For, example, “Hello” included in a calculation evaluates to Hello, but “/”Hello/”” evaluates to “Hello”.
 •
 •
 •
 •
 •
 •
 •
 •
 •
Calculation examples
 
Related topics 
About formulas
Working with formulas and functions
About functions
Changing calculation formulas
Formatting and setting up field objects in Layout mode