Calculates the standard deviation of the specified set. The calculation is based upon a sample of a population. Standard deviation is a measure of how widely values are dispersed from their mean (average).
Syntax
Stddev ( set [,numeric_value_expression [,IncludeEmpty] ])
Parameter | Description |
---|---|
A valid MDX set specification. | |
numeric_value_expression | A numeric value or an expression that returns a numeric value (see MDX Grammar Rules). |
IncludeEmpty | Use this keyword if you want to include in the calculation any tuples with #MISSING values. Otherwise, they are omitted by default. |
Example
The following example, based on Sample Basic, calculates the standard deviation (based on a sample of a population) of the January sales values for all products sold in New York.
WITH MEMBER [Measures].[Std Deviation] AS 'Stddev( Crossjoin( {[Product].Children}, {[Measures].[Sales]} ) ) ' SELECT {[Scenario].[Actual],[Scenario].[Budget]} ON COLUMNS, {Crossjoin( {[Measures].[Sales]},{[Product].Children} ), Crossjoin( {[Measures].[Sales], [Measures].[Std Deviation]}, {[Product]} )} ON ROWS FROM Sample.Basic WHERE ([Year].[Jan], [Market].[New York])
This query returns the following grid:
(axis) | Actual | Budget |
---|---|---|
(Sales, 100) | 678 | 640 |
(Sales, 200) | 551 | 530 |
(Sales, 300) | 663 | 510 |
(Sales, 400) | 587 | 620 |
(Sales, Diet) | #Missing | #Missing |
(Sales, Product) | 2479 | 2300 |
(Std Deviation, Product) | 60.723 | 64.55 |
See Also