percentile_tdigest()
Calculates the percentile result from the tdigest results (which was generated by tdigest() or tdigest_merge())
Syntax
percentile_tdigest(Expr, Percentile1 , typeLiteral)
Arguments
- Expr: Expression that was generated by
tdigestor tdigest_merge(). - Percentile is a double constant that specifies the percentile.
- typeLiteral: An optional type literal (for example,
typeof(long)). If provided, the result set will be of this type.
Returns
The percentile value of each value in Expr.
Tips
If the type was provided, the result will be a column of the same type provided with the results of the percentile. In this case, all
tdigestfunctions must be of that type.If
Exprincludestdigestfunctions of different types, don't provide the type. The result will be of type dynamic. See below examples.
Examples
StormEvents
| summarize tdigestRes = tdigest(DamageProperty) by State
| project percentile_tdigest(tdigestRes, 100, typeof(int))
| percentile_tdigest_tdigestRes |
|---|
| 0 |
| 62000000 |
| 110000000 |
| 1200000 |
| 250000 |
StormEvents
| summarize tdigestRes = tdigest(DamageProperty) by State
| union (StormEvents | summarize tdigestRes = tdigest(EndTime) by State)
| project percentile_tdigest(tdigestRes, 100)
| percentile_tdigest_tdigestRes |
|---|
| [0] |
| [62000000] |
| ["2007-12-20T11:30:00.0000000Z"] |
| ["2007-12-31T23:59:00.0000000Z"] |
Feedback
Submit and view feedback for