Database Reference
In-Depth Information
NOTE
Obviously, you have some gray area here. When in doubt, store the field. You can always make it
unstored later. Choose File→Manage Database, switch to the Fields tab if necessary, select your cal-
culation field from the list, click Options and then click Storage Options to find the “Do not store
calculation results−recalculate as needed” option.
Indexing Calculations
Unless they're global fields or unstored fields, you can set indexing for calculation fields just
like any other field, as discussed on Manual Indexing . The available options and their effects
depend on the result type of the calculation: text, number, date, or time.
Global Calculation Fields
A calculation field can use global storage ( Global Storage ) just like most other fields. When
you turn on “Use global storage” (see Figure 16-2 ), FileMaker calculates just one value for
the entire table, rather than a value for each record. If your calculation uses other global
fields—and no other fields—then it works just as you expect. That is, when you modify one
of the global fields it depends on, FileMaker automatically recalculates its value.
If the calculation uses non-global fields, on the other hand, things get a little tricky. Whenev-
er you change one of the fields referenced in the calculation, FileMaker recalculates the glob-
al calculation field by using the values from the current record. For example, if you turn on
“Use global storage” for your Full Name field, then it shows the name of the person you're
looking at when you dismiss the Manage Database window. If you were on the first record,
that's whose name you see in the field, just as expected. But as you flip through the records,
you see that first person's name on every record. You're changing records, but with global
storage, the Full Name value stays the same. That's because nothing it depends on has
changed.
Now imagine you switch to the last record. If you then change the First Name field, Full
Name recalculates. This new value displays the first and last name from the last record, since
FileMaker reevaluates the calculation in its entirety.
This behavior may seem kind of odd, but it has a really cool use. If you need to track the data
in the last record you changed —maybe you need an informal audit of which record just got
changed while you were scanning through other records—throw a global calculation field on
your data entry layout. Then, no matter which record you're looking at, you see the value
from the last edited record in that field.
Search WWH ::




Custom Search