Skip to main content

$$max

Returns the max of all values in the array

Usage​

{
"$$max": [ /* values */ ],
"by": /* Transformer */,
"type": /* type of values (to compare by) */,
"default": /* 0 */
}
"$$max([default],[type],[by]):{input}"

Returns​

BigDecimal

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray to sum
defaultBigDecimal0The default value to use for empty values
byTransformer(##current)Input is ##current (current element)"##current"A transformer to extract a property to sum by (using ##current to refer to the current item)
typeEnumauto/string/number/booleanautoType of values to expect when ordering the input array

Examples​

Input

Definition

Output

[4, -2, 13.45, null]
"$$max($$long:40):$"
40
[4, -2, 13.45, null]
"$$max(-8,NUMBER):$"
13.45
[4, -2, 13.45, null]
"$$max:$"
13.45
[4, -2, 13.45, null]
"$$max(z,STRING):$"
"z"
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$max": "$",
"by": "##current.value",
"default":"zz",
"type":"STRING"
}
"zz"
[
{ "value": 4 },
{ "value": 2 },
{ "value": 13.45 },
{ "value": null }
]
{
"$$min": "$",
"by": "##current.value"
}
13.45