stdevp
stdevp — aggregate function to return the population standard deviation 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 population standard deviation of those values.
Expression expr
must be the name of a
column in a LiveView table, where that column's data type is int, long, double, or
timestamp. If the field's type is an int, double, or long, it returns a double. If
the field's type is a timestamp, it returns an interval timestamp. For timestamp
values, the input field should contain all interval timestamps or all absolute
timestamps, but not both.
This function calculates its return value based on the biased or n method, and is usually used when the incoming data represents the entire population of data. Use stdev, which calculates its return value using the unbiased or n-1 method, when the incoming data represents a random sample of data.
EXAMPLE
This example shows how to use dynamic aggregation to find the population standard deviation of the values in a column. In the Hello LiveView sample, create a query that finds the population standard deviation value 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, stdevp(quantityRemaining) AS stdQuantityAll
-
In the Query field, enter the following:
group by category
-
Click
.
The query results open in a grid view. LiveView Server recalculates the population standard deviation value whenever the rows returned by the query predicate change.
SEE ALSO
This LiveView aggregate function is based on the stdevp aggregate function in the StreamBase expression language.