Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

MAX (Dates)

MAX (Dates)

Returns the latest date found within a port or group. You can apply a filter to limit the rows in the search. You can nest only one other aggregate function within MAX.
You can also use MAX to return the largest numeric value or the highest string value in a port or group.

Syntax

MAX(
date
[,
filter_condition
] )
The following table describes the arguments for this command:
Argument
Required/
Optional
Description
date
Required
Date/Time datatype. Passes the date for which you want to return a maximum date. 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

Date.
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).

Example

You can return the maximum date for a port or group. The following expression returns the maximum order date for flashlights:
MAX( ORDERDATE, ITEM_NAME='Flashlight' )
ITEM_NAME
ORDER_DATE
Flashlight
Apr 20 1998
Regulator System
May 15 1998
Flashlight
Sep 21 1998
Diving Hood
Aug 18 1998
Flashlight
NULL