> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# StdDev

> Use the Sigma StdDev function to compute the standard deviation of a column or group.

The **StdDev** function computes the standard deviation of a column or group. It measures the spread of a set of observations (numbers) around the mean and is calculated as the square root of the variance. A low standard deviation suggests data points are clustered near the mean, whereas a high standard deviation suggests data points are generally far from the mean.

Standard deviation is a useful measure of spread for symmetrical distributions with no outliers. It is expressed in the same units of measurement as the data and can help determine the statistical distribution of a dataset.

Sigma calls the underlying Cloud Data Warehouse's Standard Deviation function that uses the statistical **sample** definition. Check the documentation of the database you use for details on the function called.

The **StdDev** function is an aggregate function.

Aggregate functions evaluate one or more rows of data and return a single value.

In a table element, the aggregate is calculated for each grouping. For information on how to add a grouping with an aggregate calculation to a table, see [Group columns in a table](/docs/create-and-manage-tables#group-columns-in-a-table).

In a table with no groupings, the aggregate is calculated for each row. For information on how to calculate summary statistics across all rows in a table, see [Add summary statistics to a table](/docs/create-and-manage-tables#add-summary-statistics-to-a-table).

To learn more about using aggregate functions, see [Building complex formulas with grouped data](https://www.sigmacomputing.com/resources/training-videos/table-grouping-and-functions#complex-formulas).

## Syntax

`StdDev(column)`

Function arguments:

* **column** (required) - The column of numbers to be measured.

The underlying formula is as follows:

```
√(x_i-x)^2/n-1
```

where `x_i` is the value of one observation, x is the mean value of all observations, and n is the number of observations (sample size). 

## Example

```
StdDev([x])
```

* Return the sample standard deviation of non-null records in the *x* column for each group *K*.

![](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/ce353485aecf8d8d1716aa05759e73666bce9361a0db6d53fc4c178ca0ac713e/assets/docs-images/bfd8078-k.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260726%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260726T002910Z&X-Amz-Expires=604800&X-Amz-Signature=66699899f5e78d63b5057d5145cade97469eb3e244ab534af63dfdc66aa5f9b3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [CumulativeStdDev](/docs/cumulativestddev)
* [Variance](/docs/variance)
* [MovingStddev](/docs/movingstddev)