percentile_array_tdigest()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Calculates the percentile result from the tdigest results (which was generated by tdigest() or tdigest_merge())

Syntax

percentiles_array_tdigest(tdigest, percentile1 [, percentile2, ...])

percentiles_array_tdigest(tdigest, Dynamic array [, typeLiteral ])

Learn more about syntax conventions.

Parameters

Name Type Required Description
tdigest string ✔️ The tdigest or tdigest_merge() results used to calculate the percentiles.
percentile real ✔️ A value or comma-separated list of values that specifies the percentiles.
Dynamic array dynamic ✔️ A dynamic array of real numbers that specify the percentiles.
typeLiteral string A type literal. For example, typeof(long). If provided, the result set is of this type.

Returns

The percentile/percentiles value of each value in tdigest.

Tip

  • The function must receive at least one percent (and maybe more, see the syntax above: percentile1 [, percentile2] ...[, percentileN]) and the result will be a dynamic array that includes the results. (such like percentiles())
  • If only one percent was provided, and the type was provided also, then the result will be a column of the same type provided with the results of that percent. In this case, all tdigest functions must be of that type.
  • If tdigest includes tdigest functions 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 percentiles_array_tdigest(tdigestRes, range(0, 100, 50), typeof(int))

Output

percentile_tdigest_tdigestRes
[0,0,0]
[0,0,62000000]
[0,0,110000000]
[0,0,1200000]
[0,0,250000]