Max

The Max function finds the maximum value for a column summary or group.

📘

The Max function is an aggregate function.

Aggregate functions evaluate one or more rows of data and return a single value.

In a table element, the aggregate is calculated for each grouping. For information on how to add a grouping with an aggregate calculation to a table, see Group columns in a table.

In a table with no groupings, the aggregate is calculated for each row. For information on how to calculate summary statistics across all rows in a table, see Add summary statistics to a table.

To learn more about using aggregate functions, see Building complex formulas with grouped data.

Syntax

Max(field)

Function arguments:

  • field (required) - The column to be searched. Can be of type Number, Date, and String.

The maximum for strings is determined by sort order, which is affected by your database settings. Sort order is most often blank spaces > special characters > numbers > uppercase letters > lowercase letters. For numbers, preceding and trailing zeroes often have no affect on sort order.

Example

Max([Invoice Date])

When used in a table summary, returns the greatest invoice date, which is the most recent date in the [Invoice Date] column.

Max([Name])

When used in a table summary, returns the name that is alphabetically last from the [Name] column.

GrandTotal(Max([Cost]))

When used in a calculated column in a table, returns the greatest cost from the [Cost] column in each row.