# percentile_tdigest()percentile_tdigest()

## 语法Syntax

`percentile_tdigest(``Expr` `,` Percentile1 [`,` typeLiteral ]`)``percentile_tdigest(``Expr``,` Percentile1 [`,` typeLiteral ]`)`

`percentiles_array_tdigest(``Expr` `,` Percentile1 [`,` Percentile2 ] ...[`,` PercentileN ]`)``percentiles_array_tdigest(``Expr``,` Percentile1 [`,` Percentile2 ] ...[`,` PercentileN ]`)`

`percentiles_array_tdigest(``Expr` `,` 动态数组`)``percentiles_array_tdigest(``Expr``,` Dynamic array`)`

## 参数Arguments

• Expr：已由 `tdigest`tdigest_merge() 生成的表达式。Expr : Expression that was generated by `tdigest` or tdigest_merge().
• Percentile 是一个双精度常量，用于指定百分位数。Percentile is a double constant that specifies the percentile.
• typeLiteral：可选的类型文本（例如 `typeof(long)`）。typeLiteral : An optional type literal (for example, `typeof(long)`). 如果提供，结果集将为此类型。If provided, the result set will be of this type.
• 动态数组：整数或浮点数动态数组中的百分位数列表。Dynamic array : list of percentiles in a dynamic array of integer or floating point numbers.

## 返回Returns

`Expr` 中每个值的百分位数/percentilesw 值。The percentiles/percentilesw value of each value in `Expr` .

• 此函数必须至少接收一个百分比（或者可能更多，请参阅上面的语法：Percentile1 [`,` Percentile2] ...[`,` PercentileN]），结果将是一个包含结果的动态数组。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. 在这种情况下，所有 `tdigest` 函数都必须为该类型。In this case, all `tdigest` functions must be of that type.

• 如果 `Expr` 包含不同类型的 `tdigest` 函数，请不要提供类型。If `Expr` 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 percentile_tdigest(tdigestRes, 100, typeof(int))
``````
percentile_tdigest_tdigestRespercentile_tdigest_tdigestRes
00
6200000062000000
110000000110000000
12000001200000
250000250000
``````StormEvents
| summarize tdigestRes = tdigest(DamageProperty) by State
| project percentiles_array_tdigest(tdigestRes, range(0, 100, 50), typeof(int))
``````
percentile_tdigest_tdigestRespercentile_tdigest_tdigestRes
[0,0,0][0,0,0]
[0,0,62000000][0,0,62000000]
[0,0,110000000][0,0,110000000]
[0,0,1200000][0,0,1200000]
[0,0,250000][0,0,250000]
``````StormEvents
| summarize tdigestRes = tdigest(DamageProperty) by State
| union (StormEvents | summarize tdigestRes = tdigest(EndTime) by State)
| project percentile_tdigest(tdigestRes, 100)
``````
percentile_tdigest_tdigestRespercentile_tdigest_tdigestRes
[0][0]
[62000000][62000000]
["2007-12-20T11:30:00.0000000Z"]["2007-12-20T11:30:00.0000000Z"]
["2007-12-31T23:59:00.0000000Z"]["2007-12-31T23:59:00.0000000Z"]