Database Reference
In-Depth Information
UP TO SPEED: THE MAX() AND MIN() FUNCTIONS
Often, you need to know either the highest or lowest value in a series. The Max() function and its
opposite, Min() , fulfill these needs, and you find them in the function list's aggregate functions cat-
egory. Like all the aggregate functions, these functions expect at least one parameter and are glad to
get more. Every parameter should be a number. Your parameters can be any of the following:
▪ Constant data
▪ Fields within a record
▪ Repeating fields
▪ All related fields
▪ Fields from the first of record from one or more tables
The max function looks at every number referenced and returns whichever is largest. Min() , on the
other hand, returns the smallest value.
For example, look at this calculation:
Max ( 10 ; 3 ; 72 ; 19 ; 1 )
Its result is 72, since that's the largest parameter.
If you have a repeating field called Distances that holds the distances from your office to each
Krispy Kreme store in your city, then you can use this calculation to find the closest sugar fix:
Min ( Distances )
The same is true for related fields, too. This calculation finds the most expensive line item on an in-
voice:
Max ( Line Items::Price )
With both repeating fields and related fields, you pass just one field to the Min() or Max() function,
but FileMaker considers all the values in that field. If the field is a repeating field, then FileMaker
considers every repetition. If it's a related field, then its value from every related record is con-
sidered. But you can refer to multiple related tables, too. If you have several tables of updates, each
with a date the update was done, then you can find the first update this way:
Min ( Name::Update ; License::Update ;
Department::Update )
Search WWH ::




Custom Search