percentrank_tdigest()
Learn how to use the percentrank_tdigest() function to calculate the approximate rank of the value in a set.
Calculates the approximate rank of the value in a set, where rank is expressed as a percentage of the set’s size. This function can be viewed as the inverse of the percentile.
Syntax
percentrank_tdigest(
digest,
value)
Parameters
Name | Type | Required | Description |
---|---|---|---|
digest | string | ✔️ | An expression that was generated by tdigest() or tdigest_merge(). |
value | scalar | ✔️ | An expression representing a value to be used for percentage ranking calculation. |
Returns
The percentage rank of value in a dataset.
Examples
Getting the percentrank_tdigest() of the damage property that valued 4490$ is ~85%:
StormEvents
| summarize tdigestRes = tdigest(DamageProperty)
| project percentrank_tdigest(tdigestRes, 4490)
Output
Column1 |
---|
85.0015237192293 |
Using percentile 85 over the damage property should give 4490$:
StormEvents
| summarize tdigestRes = tdigest(DamageProperty)
| project percentile_tdigest(tdigestRes, 85, typeof(long))
Output
percentile_tdigest_tdigestRes |
---|
4490 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.