Returns the highest string value found within a field or group. You can apply a filter to limit the rows in the search. You can also use MAX to return the latest date or the largest numeric value in a field or group.
Note: The MAX function uses the same sort order that the Sorter transformation uses. However, the MAX function is case sensitive, and the Sorter transformation may not be case sensitive.
You can nest only one other aggregate function within MAX. You cannot nest aggregate functions in advanced mode.
Use only in mapping tasks.
Syntax
MAX( string [, filter_condition] )
Argument
Required/
Optional
Description
string
Required
String data type. Passes the string values for which you want to return a maximum string value. You can enter any valid transformation expression.
filter_condition
Optional
Limits the rows in the search. The filter condition must be a numeric value or evaluate to TRUE, FALSE, or NULL. You can enter any valid transformation expression.
Return Value
String.
NULL if all values passed to the function are NULL, or if no rows are selected (for example, the filter condition evaluates to FALSE or NULL for all rows).
Nulls
If a value is NULL, MAX ignores it. However, if all values passed from the field are NULL, MAX returns NULL.
Group By
MAX groups values based on group by fields you define in the transformation, returning one result for each group.
If there is no group by field, MAX treats all rows as one group, returning one value.
Example
The following expression returns the maximum item name for manufacturer ID 104: