variance
variance — aggregate function to return the variance of a range of values.
DESCRIPTION
This function computes a value for each record returned by the query predicate, or from the specified column of a base table, and returns the variance of those values.
Variance is a measure of the dispersion of a set of data points around their mean value. It is a mathematical expectation of the average squared deviations from the mean. Variance measures the variability (volatility) from an average, and can be applied as a measure of risk. For example, this statistic can help determine the risk an investor might take on when purchasing a specific security.
The variance() function is calculated using the unbiased (or n1) method, and is usually used when the incoming data represents a random sample. Use variancep() when the incoming data represents the entire population of data.
Expression expr
must include the name of a
column in a LiveView table, where that column's data type is int, long, or double.
The returned value is of type double.
EXAMPLE
This example shows how to use dynamic aggregation to find the variance of the values in a column. In the Hello LiveView sample, create a query that finds the variance of the quantityRemaining field from the ItemSales table, grouping by Item. Follow these steps:

In LiveView Desktop connected to a server running the Hello LiveView sample, select the ItemsSales table from the Tables pane of the LiveView Tables view.

In the Select field, enter:
category, variance(quantityRemaining) AS varQuantity

In the Query field, enter the following:
group by category

Click
.
The query results open in a grid view. LiveView Server recalculates the variance value whenever the rows returned by the query predicate change.
SEE ALSO
This LiveView aggregate function is based on the variance aggregate function in the StreamBase expression language.