Go to Contents  
Contents > Specify Calculation dialog box

Specify Calculation dialog box

This dialog box appears so that you can build a formula for a calculation or calculated field.
1. 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.
For more information on the use of context in calculations, see Choosing the evaluation context for a calculation field.
2. Build a formula for your calculation.
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.)
To add a Do this
Reference to a field
In the field list, double-click a field name.
To display field names from another table, choose a table from the tables list.
Note  When the Specify Calculation dialog box opens from within the Replace Field Contents and Send Mail dialog boxes, the tables list may default to Current Layout (LayoutName) and display only the visible fields on the current layout. To display all field names from the current table, choose Current Table (TableName) from the list.
Mathematical or text operator
For Operators, click a button or type an operator.
Comparison or logical operator
For Operators, double-click an operator in the list or type an operator.
Constant value
Type the value.
Function
In the functions list, double-click a function. In the formula box, replace the placeholder parameter with a value or expression.
To quickly build a formula:
Tab to or click in the field, operators, or functions list.
Type the first few letters of a field name, operator, or function to move to that item in the list.
Press Insert (Windows) or the Space bar (Mac OS) to place it in the formula box.
3. Select calculation options for the field.
To Do this
Set the field type of the result
Choose a data type for Calculation result is <value>.
Choose the correct type for the result you want. See About choosing a field type.
Make a calculated field repeating
Select Number of repetitions, then type the number of repetitions. See Defining repeating fields.
Prevent calculation if all referenced fields are empty
Select Do not evaluate if all referenced fields are empty.
When enabled, FileMaker Pro does not evaluate a calculation if all fields used by the calculation are empty. This typically improves performance.
4. 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).
5. Click OK.
Important   To avoid confusion when using dates in FileMaker Pro, always define calculation formulas to enter four-digit years. For more information, see Conversion of dates with two-digit years.
Notes
You can type field names, operators, and functions in the Specify Calculation dialog box instead of using the fields or operators lists.
If you are using FileMaker Pro Advanced to customize menus, you can base a menu or menu item title on the result of a calculation. You can also create tooltips based on a calculation. See Defining custom menus (FileMaker Pro Advanced) and Adding tooltips on layouts (FileMaker Pro Advanced) for more information.
Related topics
Replacing the contents of a field
Defining calculation fields
Defining automatic data entry
Defining field validation
Defining field indexing options
Changing calculation formulas
About formulas
Adding a new line to the results of a formula
Adding comments to a formula
Perform Script script step
Pause/Resume Script script step
If script step
Exit Loop If script step
Go to Layout script step
Set Field script step
Insert Calculated Result script step
Replace Field Contents script step
Defining conditional formatting for layout objects


Contents > Specify Calculation dialog box