{
  "id": "tdigest.max",
  "title": "TDIGEST.MAX",
  "url": "https://redis.io/docs/latest/commands/tdigest.max/",
  "summary": "Returns the maximum observation value from a t-digest sketch",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-04-09T10:29:34-04:00",
  "page_type": "content",
  "content_hash": "8330e6dddac24c7f978b4e7eac25a87ce7cc178785387174aea83f76327dd39d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the maximum observation value from a t-digest sketch."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nis the key name for an existing t-digest sketch.\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> TDIGEST.CREATE t\nOK\nredis> TDIGEST.MAX t\n\"nan\"\nredis> TDIGEST.ADD t 3 4 1 2 5\nOK\nredis>TDIGEST.MAX t\n\"5\""
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n\n* [Bulk string reply]() as floating-point representing the maximum observation value from the given sketch. The result is always accurate. `nan` is returned if the sketch is empty.\n* [Simple string reply]() in these cases: incorrect number of arguments or incorrect key type.\n\n**RESP3:**\n\nOne of the following:\n\n* [Double reply]() representing the maximum observation value from the given sketch. The result is always accurate. `nan` is returned if the sketch is empty.\n* [Simple string reply]() in these cases: incorrect number of arguments or incorrect key type."
    }
  ],
  "examples": []
}
