content/commands/tdigest.byrank.md
Returns, for each input rank, a floating-point estimation of the value with that rank. Multiple estimations can be retrieved in a single call.
is the key name of an existing t-digest sketch.
</details> <details open><summary><code>rank</code></summary>Ranks for which the values should be retrieved.
0 is the rank of the value of the smallest observation.
n-1 is the rank of the value of the largest observation, where n denotes the number of observations that have been added to the sketch.
</details>{{< highlight bash >}} redis> TDIGEST.CREATE t COMPRESSION 1000 OK redis> TDIGEST.ADD t 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 OK redis> TDIGEST.BYRANK t 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported"><nobr>✅ Flexible & Annual</nobr></span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="tdigest-byrank-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
rank is 0, the value of the smallest observation.rank is n-1, the value of the largest observation, where n denotes the number of observations added to the sketch.inf when rank is equal to n or larger than n.nan for all ranks when the given sketch is empty.-tab-sep-
One of the following:
rank is 0, the value of the smallest observation.rank is n-1, the value of the largest observation, where n denotes the number of observations added to the sketch.inf when rank is equal to n or larger than n.nan for all ranks when the given sketch is empty.{{< /multitabs >}}