max
function returns the highest value of an attribute among a group of items.
For example, if a template is scoped to products with different prices, use this function to return the highest price. If you’re not searching for the maximum value, you can use any(value)
instead.
Note: This function is only available in Templates and can’t be used in Reporting.
Syntax
max(value)
Parameter
value
: Any type of attribute or column (number, text, or boolean). The function returns the highest value of this attribute for one of the selected items.
Example
- The following function in an ad template returns the highest sale price of all items in an ad group:
"Never pay more than " & [to_text(max(ITEM_PRICE))]