min(X;Y)
Returns the smaller of two given values.
Syntax
min(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 smaller 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 |
min(X;Y) |
---|---|---|
2 | 1 | 1 (integer) |
2 | 3 | 2 (integer) |
1.5 | 1 | 1 (decimal) |
1.5 | 2.5 | 1.5 (decimal) |
1.5 | 1.2 | 1.2 (decimal) |
NA | 1 | NA (integer) |
1.0 | NA | NA (decimal) |
Example
In this example, the min(X;Y)
function returns the minimum 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="min" value="min(r;h)" label="Minimum"/> <colord cols="r,h,min"/>