MicroStrategy ONE
RunningStDev (Running Standard Deviation)
Returns the running standard deviation of a sample for a value expression. The list of values supplied is the sample. The calculation can restart based on attributes identified in the function parameters. This is an OLAP function.
Syntax
RunningStDev<BreakBy,SortBy>(
Argument
)
Where:
BreakBy
is the attribute indicating where the calculation restarts.SortBy
is the attribute or metric by which the data is sorted.Argument
is a metric representing the list of numbers.
Expression
Example
This example shows a report where the running standard deviation of the revenue is calculated. This calculation is based on the assumption that the list of values supplied in the metric represents a sample of the data for which you want to obtain the standard deviation. The calculation starts over for each region, and the information is sorted within the region by state in ascending order.
Compare this example report to the example for RunningStDevP to see the different values returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics Total Revenue, RunningStDev, and StDev. A report filter is used to limit the data to the Southwest, Southeast and Northwest regions. The definition of the RunningStDev metric is as follows:
RunningStDev<BreakBy={[Customer Region]}, SortBy=<[Customer State])>([Total Revenue])