Database Reference
In-Depth Information
tax —the order of elements and punctuation—is critical when you're creating calculations. So
before you learn more tricks, this section outlines common calculation terms and rules of
thumb.
NOTE
Calculations are often called calcs for short, or formulas . Although some slight differences exist
between a calculation and a formula, people usually use the terms interchangeably. Sometimes, a
formula is so useful or common that FileMaker defines it as a reusable formula, also known as a
function .
In the next examples, don't focus on what the example calculation does. You'll get to that.
Right now, focus on structure. A calculation can be short and simple:
Pi * Diameter
Or it can be more complicated:
Case (
Shape = "Circle" ;
Pi * (Diameter/2) ^ 2 ;
Shape = "Rectangle" ;
ShapeLength * Width ;
)
NOTE
To avoid headaches, never give a field the same name as an existing function. The field containing
the length of a rectangular object has the unwieldy name “ShapeLength” to avoid confusion with
FileMaker's Length() function. The field name “Width” is fine, because there's no width function.
A complete list of FileMaker functions can be found at www.filemaker.com/help/html/
help_func_alpha.html .
In fact, calculations can be really long and complicated if you need them to be—up to 30,000
characters. Practically speaking, the only limit on the complexity of a calculation is your pa-
tience for creating it.
Regardless of its complexity, a calculation, or formula, is made up of three different ele-
ments: field references, constants , and operators . In the first example above, “pi” is a con-
stant, “*” is an operator, and “Diameter” is the name of a field. The second example uses a
function called a “case statement.” In that example, “Shape” and “Diameter” are field refer-
ences, “Circle” and “2” are constants, and “=,” “*,” and “^” are operators.
Search WWH ::




Custom Search