MAX()

Highest item in list

Returns the highest value in a list. If list is an empty list of numerical values, returns 0.

Sample usage

MAX(Products[Price]) returns the highest of all values in the Price column of the Products table. Equivalent to MAX(SELECT(Products[Price], TRUE)). See also: SELECT()

MAX([Discounts])returns the highest of the items in the Discounts column value, where Discounts is of type List.

MAX(LIST(1, 2, 3)) returns Number: 3

Highest from select values

Highest discount given to non-employees within the past month:

MAX(
  SELECT(
    Sales[Discount Amt],
    AND(
      NOT([Customer].[Is Employee?]),
      ([Sale Date] > (
        EOMONTH(TODAY(), -2) + DAY(TODAY())
      ))
    )
  )
)
  1. SELECT(Sales[Discount Amt], ...) returns a list of values from the Discount Amt column from rows of the Sales table.
  2. AND(..., ...) limits the values returned to only those from rows that match all of the given conditions.
  3. NOT([Customer].[Is Employee?]) excludes those rows with a Customer column value that refers to a customer record that indicates the customer is also an employee.
  4. [Sale Date] > ... includes only those rows with a Sale Date column value later than the computed date.
  5. EOMONTH(TODAY(), -2) + DAY(TODAY()) computes the date for one month ago today.
  6. MAX(...) returns the highest value in the select list of Discount Amt values.

See also: AND(), DAY(), EOMONTH(), NOT(), SELECT(), TODAY()

Common Problems

MAX(1, 2, 3) In this example, the arguments are not in list form. To fix, wrap them in LIST() to construct a list: MAX(LIST(1, 2, 3)).

Syntax

MAX(list)

  • list - List of any numeric type.

Notes

AppSheet must be given enough context to determine what type of values list contains, that its contents are or will be numeric. To that end, list must be one of the following: a column value of type List that contains numeric values; a column list (for example, Products[Price]) for a column of a numeric type; or a constructed list (for example, with LIST()) of a numeric type.

See also

AVERAGE()

COUNT()

MIN()

STDEVP()

SUM()

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false