MAXIMUM

Returns the maximum value of a field on the child table for each parent record. The optional filter query argument can be used to restrict the records included in the calculation.

MAXIMUM works in date order for dates (giving latest date), numeric order for numbers (largest number) and alphabetical for text (latest letter). MINIMUM works the other way around.

MAXIMUM ( <field_name> [, Index [, <filter_query>] ] )
  • field_name: The field to return the value from

  • index: Specifies the index value to be used. An index of 1 indicates the highest (maximum) value; an index of 2 indicates the second highest value, and so on.

  • filter_query: A query string representing the domain of records to include.

Example: create a field on the CUSTOMER table to return the 2nd highest maximum value of products of type B that each customer purchased.

MAXIMUM([PRODUCT.PRODUCT_VALUE],2, [PRODUCT.PRODUCT_CODE]= "B")