Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

MAX (Dates)

MAX (Dates)

Returns the latest date 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 largest numeric value or the highest string value in a field or group.
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(
date
[,
filter_condition
] )
Argument
Required/
Optional
Description
date
Required
Date/time data type. 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 field 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
RETURN VALUE:
Sep 21 1998

0 COMMENTS

We’d like to hear from you!
Jocelyn Habeillon-Wolf - October 06, 2022

The Return value answer to your example is missing.

Informatica Documentation Team - October 18, 2022

Hello again, Jocelyn. We have confirmed with our QA team that the return value in this example will be "Sep 21 1998." We will update the documentation to include the return value. You should see the update in the next monthly release.


Informatica Documentation Team - October 07, 2022

Thanks so much for reaching out, Jocelyn! We are currently verifying the correct return value and will get back to you.

Sincerely,

Informatica Documentation Team