max(X;Y)
Returns the larger of two given values.
Syntax
max(X;Y)
Input
| Argument | Type | Description |
|---|---|---|
X |
any numeric type | The value to compare to Y |
Y |
any numeric type | The value to compare to X |
Return Value
Returns a numeric value corresponding to the larger value of X and
Y.
If both X and Y are integers, the result is an integer;
otherwise, the result is a decimal number.
If X and/or Y is N/A, the result is N/A.
Sample Usage
X |
Y |
max(X;Y) |
|---|---|---|
| 2 | 1 | 2 (integer) |
| 2 | 3 | 3 (integer) |
| 1.5 | 1 | 1.5 (decimal) |
| 1.5 | 2.5 | 2.5 (decimal) |
| 1.5 | 1.2 | 1.5 (decimal) |
| NA | 1 | 1 (integer) |
| 1.0 | NA | 1 (decimal) |
| NA | NA | NA (integer) |
Example
In this example, the max(X;Y) function returns the maximum value between
the runs and hits using the columns r and h respectively
from pub.demo.baseball.postbatting.
<base table="pub.demo.baseball.postbatting"/> <willbe name="max" value="max(r;h)" label="Maximum"/> <colord cols="r,h,max"/>

