MicroStrategy ONE
StDev (Standard Deviation of a Sample)
The standard deviation is an indicator of how widely values in a group differ from the mean. It is useful for comparing different sets of values with a similar mean.
StDev
returns the standard deviation of a population based on a sample. This is a group-value function.
Syntax
StDev <Distinct, FactID>(
Argument
)
Where:
Argument
is an attribute, fact, or metric representing a list of numbers.Distinct
is aTRUE
/FALSE
parameter that allows you to calculate using all values in the list or only the unique values.FactID
is a parameter that forces a calculation to take place on a fact table that contains the selected fact.
Expression
Usage Notes
- In this function, arguments correspond to a population sample as opposed to the entire population. For entire populations, see StDevP (Standard Deviation of a Population).
- To perform a weighted standard deviation, see WeightedStDev (Weighted Standard Deviation of a Sample).
- When very large population samples are used, this function and the StDevP (Standard Deviation of a Population)function return approximately equal results.
Example
This example shows a report where the 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 is based on the revenue values for each state within a region and calculated at the region level.
Compare this example report to the example for StDevP 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 and StDev. A report filter limits the regions displayed to South, Northwest, and Southwest. The definition of the StDev metric is as follows:
StDev([Total Revenue]){[Customer Region], ~}