{{getMsg('Help_YouAreHere')}}:
/
{{page.title}}
{{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}}
{{helpModel.downloadHelpPdfDataStatus}}
Maximum
Computes the maximum value of a field, array or range.
You can also specify which records of the field should be included.
Usage:
Maximum( fld ) Maximum( fld, condFld ) Maximum( fld, condFld, cond ) Maximum( array or range )
Parameters:
fld | The name of a field whose values should be used to calculate the maximum value. |
---|---|
condFld | The name of the field that groups the values of fld (if fld isn't an array). |
cond | A string declaring the type of grouping to be used on condFld. This only makes sense for groups based on Date, DateTime, Time, and Boolean fields. See Summary Field Conditions for a list of strings you can use here. |
array or range | The name of an array or range variable whose elements should be used to calculate the maximum value. |
Returns:
Fractional numeric maximum value of the field or array
Examples:
//returns the maximum value of the array maximum([2,5,3,2,9,6,4,3,2,5,7,8,5,1,3,6,4]) //returns 9
//assigns the maximum value of the array to a number variable (crystal syntax) numberVar max := maximum([1,4,3,4,5,2,2,4,5]);
//returns the maximum value of the database field maximum({Sales.Sales_Amount})
//returns the maximum Sales_Amount grouped by Vendors maximum({Sales.Sales_Amount, Vendors.Vendor})
//a formula that depends on the maximum value of Sales_Amount numberVar max := maximum({Sales.Sales_Amount}); if {Sales.Sales_Amount} > max * 3/4 then red; if {Sales.Sales_Amount} > max * 1/2 then blue; if {Sales.Sales_Amount} > max * 1/4 then black;
Notes:
-
If the values in fld should be grouped, a group based on condFld is needed. If the group does not exist in the report, you can add it using i-net Designer or using API method: Engine.addGroup.