Aggregate functions perform calculations on a set of values and return a single summary result, such as a sum, average, maximum, or minimum. Use these built-in aggregate functions to summarize large datasets.
BI_AVG
The BI_AVG function calculates the average of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
average |
|
Return value |
Number |
|
Example |
Calculates the average of [Order Amount] based on the dimensions used in the chart. |
BI_COUNT
The BI_COUNT function returns the count of items in a group.
|
Syntax |
|
|
Arguments |
|
|
Description |
count |
|
Return value |
Number |
|
Example |
Calculates the total number of orders based on the dimensions used in the chart. |
BI_COUNTD
The BI_COUNTD function returns the number of distinct (unique) items in a group.
|
Syntax |
|
|
Arguments |
|
|
Description |
distinct count |
|
Return value |
Number |
|
Example |
Calculates the number of unique order IDs based on the dimensions used in the chart. |
BI_MAX
The BI_MAX function returns the maximum value in a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
maximum value |
|
Return value |
Number |
|
Example |
Calculates the maximum [Order Amount] based on the dimensions used in the chart. |
BI_MEDIAN
The BI_MEDIAN function returns the median value of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
median |
|
Return value |
Number |
|
Example |
Calculates the median of [Order Amount] based on the dimensions used in the chart. |
|
Limitations |
This function is not supported by the following data sources: MySQL, AnalyticDB for MySQL 3.0, Hologres, PostgreSQL, SQL Server, Lindorm, Elasticsearch, Simple Log Service (SLS), IBM DB2 LUW_V10, Gbase 8a, and Vertica. |
BI_MIN
The BI_MIN function returns the minimum value in a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
minimum value |
|
Return value |
Number |
|
Example |
Calculates the minimum [Order Amount] based on the dimensions used in the chart. |
BI_PERCENTILE
The BI_PERCENTILE function returns the value from an expression at a specified percentile.
|
Syntax |
|
|
Arguments |
|
|
Description |
Returns the value at the specified percentile from the dataset. |
|
Return value |
Number |
|
Example |
Calculates the 90th percentile value for [Order Amount] based on the dimensions used in the chart. |
|
Limitations |
This function is not supported by the following data sources: MySQL, AnalyticDB for MySQL 3.0, SQL Server, Lindorm, Shentong, IBM DB2 LUW_V10, Simple Log Service (SLS), Gbase 8a, and Vertica. |
BI_STDEV
The BI_STDEV function calculates the sample standard deviation of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
sample standard deviation |
|
Return value |
Number |
|
Example |
Calculates the sample standard deviation of [Order Amount] based on the dimensions used in the chart. |
BI_STDEVP
The BI_STDEVP function calculates the population standard deviation of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
population standard deviation |
|
Return value |
Number |
|
Example |
Calculates the population standard deviation of [Order Amount] based on the dimensions used in the chart. |
BI_SUM
The BI_SUM function returns the sum of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
sum |
|
Return value |
Number |
|
Example |
Calculates the sum of [Order Amount] based on the dimensions used in the chart. |
BI_VAR
The BI_VAR function calculates the sample variance of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
sample variance |
|
Return value |
Number |
|
Example |
Calculates the sample variance of [Order Amount] based on the dimensions used in the chart. |
BI_VARP
The BI_VARP function calculates the population variance of a set of values.
|
Syntax |
|
|
Arguments |
|
|
Description |
population variance |
|
Return value |
Number |
|
Example |
Calculates the population variance of [Order Amount] based on the dimensions used in the chart. |
|
Limitations |
This function is not supported by the following data sources: Lindorm (wide table engine, multi-model SQL) and Shentong. |