Relational Statistical Operator
The highest of operator finds the highest value in a specified field in all matching records in a related table. The result can appear as a list item in the detail area of a report or as a statistic in the summary area at the end of each group or the end of the report.
Syntax
highest of TABLENAME|RELATIONSHIP [named "UNIQUE RELATIONSHIP NAME" ] [with ( selection criteria) ] FIELDNAME ;|.
A value of the same type as the specified field. If a Text field is specified, DataEase returns the highest ASCII value. If a Choice field is specified, DataEase returns the value in the highest numbered choice (not necessarily the highest ASCII value).
Example
highest of RESERVATIONS TOTAL DUE .
This script tells DataEase: (1) Process all the MEMBERS records and list each member's LAST NAME in alphabetical order, (2) for each MEMBERS record, find all the related records in the RESERVATIONS table (those that have a matching MEMBER ID), and (3) list the highest TOTAL DUE in the set of matching RESERVATIONS records.
The output from this script, arranged in alphabetical order by LAST NAME, might look as follows:
Last Name |
Highest of Reservations Total Due |
Adams |
$3000.00 |
Albert |
$4760.00 |
Anders |
$4420.00 |
Andersen |
$2100.00 |
... |
... |
If you also want to include the highest TOTAL DUE among this group of invoices, change the fourth line of the query to read:
highest of RESERVATIONS TOTAL DUE : item max .
Note: There's an important difference between the statistical operator max and the relational statistical operator highestof. max finds the highest value in the specified field among all the records being processed. highest of finds the highest value among the records related to the records being processed.