TDIGEST.BYREVRANK key reverse_rank [reverse_rank ...]
@tdigest,
@read,
Returns, for each input reverse rank (revrank), an estimation of the floating-point value with that reverse rank.
Multiple estimations can be retrieved in a single call.
keyis the key name of an existing t-digest sketch.
revrankReverse ranks for which the values should be retrieved.
0 is the reverse rank of the value of the largest observation.
n-1 is the reverse rank of the value of the smallest observation, where n denotes the number of observations added to the sketch.
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.BYREVRANK t 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1) "5"
2) "5"
3) "5"
4) "5"
5) "5"
6) "4"
7) "4"
8) "4"
9) "4"
10) "3"
11) "3"
12) "3"
13) "2"
14) "2"
15) "1"
16) "-inf"| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
One of the following:
rank is 0, the value of the largest observation.rank is n-1, the value of the smallest 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.