> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# maxSimpleState

> Example of using the maxSimpleState combinator

<h2 id="description">
  Description
</h2>

The [`SimpleState`](/reference/functions/aggregate-functions/combinators#-simplestate) combinator can be applied to the [`max`](/reference/functions/aggregate-functions/max)
function to return the maximum value across all input values. It returns the
result with type `SimpleAggregateState`.

<h2 id="example-usage">
  Example usage
</h2>

The example given in [`minSimpleState`](/guides/clickhouse/examples/aggregate-function-combinators/minSimpleState#example-usage)
demonstrates a usage of both `maxSimpleState` and `minSimpleState`.

<h2 id="see-also">
  See also
</h2>

* [`max`](/reference/functions/aggregate-functions/max)
* [`SimpleState combinator`](/reference/functions/aggregate-functions/combinators#-simplestate)
* [`SimpleAggregateFunction type`](/reference/data-types/simpleaggregatefunction)
