> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# About Segmentation

> Segmentation in Validio lets you validate metrics per segment of your data, similar to a GROUP BY in SQL. This enables granular analysis that catches issues hidden by aggregation.

Segmentation in Validio lets you validate metrics per segment of your data, similar to a GROUP BY in SQL, enabling granular analysis that catches anomalies hidden by aggregation. For step-by-step instructions on creating segmentations, see [Segmentation Configuration](https://docs.validio.io/v10.3/docs/segmentation/segmentation-configuration.md).

![The Segmentations tab of a source listing its configured segmentations](https://mintcdn.com/validio/36lh-6_uXUsulPvT/images/docs/segmentation/segmentations-tab.png?fit=max\&auto=format\&n=36lh-6_uXUsulPvT\&q=85\&s=1a982b81bc90fe86a4f9a218ee86fa2f)

Segmentations configured on the gold\_\_sales\_summary source

Information loss occurs when [aggregating data](https://en.wikipedia.org/wiki/Aggregate_data#Limitations). Segmenting the data allows you to perform a more granular analysis.

In Validio, you can configure Segmentation to validate metrics on segments of your data. You can also use [Filters](https://docs.validio.io/v10.3/docs/filters.md) to narrow the records included in each segment, and [Windows](https://docs.validio.io/v10.3/docs/windows.md) to control how data is aggregated. Segmentation works similar to GROUP BY operations in SQL. For example, if a Segmentation is specified for the field `Marital status`, metrics are validated for each distinct value within that field.

> [!NOTE]
>
> **Segmentation with Non-Null values**
>
> Validio displays only the Segmentations with non-Null values. Fields that include a Null value will not be shown.

![A source table segmented on categorical fields, with one example tracking average age by marital status and another tracking average annual salary by education](https://mintcdn.com/validio/36lh-6_uXUsulPvT/images/docs/segmentation/segmentation-concept.png?fit=max\&auto=format\&n=36lh-6_uXUsulPvT\&q=85\&s=1fc170bdd3dad3ec2cd7998721b89513)

Segmentation allows you to validate data within segments of your data.

## Multi-field segments

You can create Segmentations on multiple fields. For example, if a Segmentation is specified for the fields `Country`, `Gender`, and `Marital status`, the metric `Average of "Annual salary"` is validated for each combination of distinct values within `Country`, `Gender`, and `Marital status`.

> [!WARNING]
>
> **Performance Impacts**
>
> Though it's not uncommon to have thousands of segments, you can expect large numbers of segments to impact performance and metric retention.

![Segmentation on the Country, Gender, and Marital status fields, tracking median annual salary for each combination of values](https://mintcdn.com/validio/36lh-6_uXUsulPvT/images/docs/segmentation/segmentation-multi-field-example.png?fit=max\&auto=format\&n=36lh-6_uXUsulPvT\&q=85\&s=0e799314ccadcb05f90a5594e79406a2)

Example Segmentation on the three fields: `Country`, `Gender`, and `Marital status`, tracking average `Annual salary` for each of the segments.

## Segmentation example

A retail organization wants to validate their price data, to make sure their products are properly priced. For validating purposes, they want to use the fields `price` and `currency`. Because of differences in currency, the prices have different orders of magnitude, which means that only validating datapoints from the `price` column makes little sense. The data must be segmented based on currency, before performing a data quality validation to make sure there are no anomalies,

Think of the difference in the order of magnitude if the same price for a specific item is expressed in USD versus Iranian Rial, where the conversion rate is \~ 1 USD = \~ 40 000 Iranian Rial.

If no Segmentation is applied to validate price data in `currency`, the retail organization would be comparing apples with cars.

![A metric graph for the Currency = IRR segment with an anomaly detected outside the threshold bounds](https://mintcdn.com/validio/36lh-6_uXUsulPvT/images/docs/segmentation/segmentation-currency-anomaly.png?fit=max\&auto=format\&n=36lh-6_uXUsulPvT\&q=85\&s=84b4c6db03eca3f8549ebb3f7ea8992a)

Example on an anomaly detected in the `Currency = IRR` segment.
