MAX()

 

Syntax:

       Then: a=MAX(n)

       Then: n=MAX(aa,ab, ...)

 

Version Ref:  4.1

 

Description:

Finds maximum value of field "n" on output, or returns the highest value in the list of fields given.

 

Examples:

For financial analysis, you want the average sales per sales representative, plus, for comparison, his or her maximum and minimum sales (see the "AVG" and "MIN" commands also). "Total Sales" is field 22. To find the maximum value, you'd put dummy field M on a subtotal line in the report format, and write the element as follows:

 

       Then: M=MAX(22)

 

Find the maximum in a list of values.

 

       Then: mx = MAX(ab,ac,ad,ae,5,12)

 

Restrictions:

For aggregate maximums, calculations are made at the subtotal and total breaks.

For comparative maximums, the fields do not have to be numeric, but they must all be comparable. For example, you may supply a list of dates or times, but not both. There must be at least two fields. If only one field is supplied, the aggregate form of the function is used.