Quick Start

Table Of Contents
Simplifying data entry
61
Generate values with a calculation field
When you want FileMaker Pro to perform a calculation for you, for
example to determine the amount of tax owed or the proper fee to be
paid, you use a calculation field. Calculation fields are one of the
FileMaker Pro field types. FileMaker Pro can perform simple and
complex calculations.
The calculation formula uses values from the current record or
related records. The formula can use values from all field types. You
can use calculations to return text values (for example, combining
the contents of first name and last name fields into a full name field),
dates, times, and the contents of container fields.
See how calculations speed data entry
Members of the Corporate Travelers Club pay an annual fee. New
members pay a fee of $200, while continuing members pay $100.
The following steps show the calculation you are going to build. The
calculation returns a membership renewal fee based on membership
type.
1. Choose Window menu > Sample07.fp5.
2. Choose Layout #1 from the layout pop-up menu if it is not already
selected.
3. Create a new record by choosing Records menu > New Record.
Notice there’s no data in the Renewal Fee field.
4. In the Membership Type field, click New. The Renewal Fee field
indicates 200.
The Renewal Fee field is a calculation field.
5. In the Membership Type field, click Continuing. The value in
Renewal Fee changes to 100.
6. Delete this record by choosing Records menu > Delete Record.
Deleting this record is necessary to set up a later part of this lesson.
7. Click Delete in the confirmation dialog box.
Create a calculation field
There are several different ways of formulating a calculation, each of
which can yield the correct result. The following method uses an If
statement to compare the data entered in the Membership Type field
with one of the membership types. The calculation returns one of two
results.
1. Choose MyFile07.fp5 from the Window menu.
2. Choose File menu > Define Fields.
3. For Field Name, type Renewal Fee.
4. For Type, click Calculation to make this a calculation field.
5. Click Create.
The Specify Calculation dialog box appears.
6. Scroll through the list of formulas in the upper-right corner of the
Specify Calculation dialog box until you locate
If (test, result one, result two). Double-click this formula so that it
appears in this dialog box.
Click Calculation