---
title: "Understanding the order of operations in segment calculations"
slug: "understanding-the-order-of-operations-in-segment-calculations"
abstract: "Describes the order of operations that Sitecore CDP follows when calculating segments (Sitecore CDP)."
---
# Understanding the order of operations in segment calculations

Understanding the order of operations is important in knowing how a segment is calculated. The [order that rules and filter groups display](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/introduction-to-batch-segmentation/edit,-move,-or-delete-a-filter-group-in-a-segment.md "Edit, move, or delete a filter group in a segment") in the segment editor determines how the segment is calculated, and can affect results.

The following is the order of operations that Sitecore CDP uses to calculate a segment:

- Evaluates segment rules within the same filter group.
- Evaluates filter groups that are combined using the **AND** comparator.
- Calculates any remaining segment rules and filter groups in the order they display.