O'Reilly logo

FileMaker Pro 9: The Missing Manual by Susan Prosser, Geoff Coffey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logical Functions

The logical function group is a diverse and powerful lot. You get functions for making decisions (called conditional functions), learning about field values, and even evaluating calculations inside other calculations. This section covers all those possibilities. Along the way, you learn how to define and use variables, which act as placeholders while complex calculations go through their many steps.

Conditional Functions

This chapter began by posing an interesting challenge: You have a calculation field in the Invoices table called Total Due. It calculates the total amount due on an invoice by subtracting the sum of all payments from the total amount of the invoice. Can you modify the Total Due calculation to add a five-percent penalty when an invoice is past due?

The answer lies in the three conditional functions. Each one lets you specify more than one possible result. The functions require one or more parameters—called conditions or conditional expressions—that tell them which result to pick. The conditional functions—If, Case, and Choose—differ in how many possible results they support and what kind of conditions they expect.

The If function

The first and most common conditional function is simply called If. The If function is the basic unit of decision making in FileMaker calculations. It's the ticket when you have to decide between two choices, based on some criteria.

It looks like this:

	If ( Condition ; True Result ; False Result )

When you use the If function, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required