# Build a segment

> Create a segment in the dashboard, combine conditions and groups, and check its reach before you save.

Source: https://docs.grovs.io/docs/analytics/segments/build-a-segment

The example below builds a segment of iOS users who bought a yearly plan in the last 90 days, then adds a second group.

## Create the segment

### 1. Open Segments

Select your project and environment, go to **Audience → Segments**, and click **New segment**.

### 2. Name it

Enter a **Name** of up to 255 characters, for example `iOS yearly buyers`.

### 3. Add the first condition

Click **Add condition**, choose **Device**, and set **Platform** is `iOS` on the **current device**.

### 4. Add a second condition to the same group

Click **Add condition**, choose **Purchase**, and set **bought** `pro_yearly`, at least 1 time, in the last 90 days.

### 5. Check the reach

The **Estimated reach** panel shows matching people and devices. It refreshes as you edit.

### 6. Save

Click **Create**. The segment's page opens with its exact count.

> **Note:** **Purchase** needs revenue tracking. Without it, the menu marks the condition **Needs revenue collection**. See [Revenue](https://docs.grovs.io/docs/revenue).

## Combine conditions

The word between two conditions is the group's operator. Click it to switch between `and` (match every condition) and `or` (match at least one). One operator applies to the whole group.

To mix both, add a group with **Add an AND group** or **Add an OR group**. The word between groups is the top-level operator; switch it the same way.

Example: "iOS yearly buyers **or** people who raised `checkout` 3 times in the last 30 days" is two groups joined by `or`:

| Group | Operator | Conditions                                                                                      |
| ----- | -------- | ----------------------------------------------------------------------------------------------- |
| 1     | and      | Platform is iOS on the current device · bought `pro_yearly` at least 1 time in the last 90 days |
| 2     | and      | did `checkout` at least 3 times in the last 30 days                                             |

A definition holds up to 5 groups of up to 10 conditions each. The add buttons are disabled at a limit.

## Use "did not"

Event and purchase conditions start with a switchable word: **did** or **did not**, **bought** or **did not buy**. Device, profile, identifier and acquisition conditions use `is not` and `is not set` instead.

A "did not" condition needs a positive condition in the same `and` group:

- did **App open** at least 1 time in the last 30 days
- **and** **did not buy** in the last 30 days

A segment with a "did not" condition alone in a group, or in an `or` group, cannot be saved.

## Read the estimate

The estimate counts people and devices for the unsaved draft.

- The first estimate can take a few seconds. It is cached for about a minute.
- "The project is busy computing other segments. Try again in a moment." means other segments are computing. Retry after a few seconds.
- "Segment is too heavy — narrow a window or remove a condition." means the segment is too expensive to compute.

## Edit, archive and restore

- **Edit**: click **Edit** on the segment page. A new definition changes who matches from then on and starts a new [size history](https://docs.grovs.io/docs/analytics/segments/size-history) line.
- **Archive**: click **Archive** and confirm. Archived segments are not evaluated and disappear from pickers.
- **Restore**: choose **Archived** in the segments list's status filter, then click **Restore**.
