> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/compute-your-audience-from-stored-data.md).

# Compute your audience from stored data

Build a Query segment from anything held in your datamart, and get it ready to activate.

## Your goal

Express criteria over the data already in your datamart, and end up with a populated, activation-ready [Query segment](/audience-and-activation/build-your-audiences/segment-reference/segment-types/query-segment.md).

## Expected outcome

A saved Query segment whose count you have sanity-checked, whose persistence and evaluation period you have chosen on purpose, and which is computed and therefore usable by feeds, other segments, analytics, and exports.

## When this is useful

Whenever the criteria that define your audience are already recorded: profile attributes, past events, purchases, imported CRM fields, computed fields, model scores, or membership of another segment. This is the default way to build an audience, and the type most other features expect.

## Prerequisites

* The fields you want to query exist in your schema and are indexed for querying.
* You know which builder you will use. See [Segment builders](/audience-and-activation/build-your-audiences/segment-reference/segment-builders.md) - the choice depends on what you know, not on what you are building.

## Concepts you need first

| Concept                                                                                                                                             | Why it matters here                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [Counting is not persistence](/audience-and-activation/build-your-audiences/segment-reference.md#counting-is-not-persistence)                       | The count you see in a builder does not mean the segment is populated.            |
| [Segment properties](/audience-and-activation/build-your-audiences/segment-reference.md#segment-properties)                                         | Persistence and evaluation period are Query-segment-only, and both are decisions. |
| [Audience features](/audience-and-activation/build-your-audiences/segment-reference/segment-builders/standard-segment-builder/audience-features.md) | If you are working in the Standard Segment Builder, these are your vocabulary.    |

## Steps

{% stepper %}
{% step %}

### Choose your builder

Pick by the knowledge available to the person building the segment:

* Business user, no schema expertise: [Standard Segment Builder](/audience-and-activation/build-your-audiences/segment-reference/segment-builders/standard-segment-builder.md).
* Comfortable with the schema, wants AND / OR conditions: [Advanced Segment Builder](/audience-and-activation/build-your-audiences/segment-reference/segment-builders/advanced-segment-builder.md).
* Schema or data expert: [Expert OTQL Builder](/audience-and-activation/build-your-audiences/segment-reference/segment-builders/expert-otql-builder.md).
  {% endstep %}

{% step %}

### Express the criteria

Assemble your conditions. In the visual builders, remember which control does what:

* In the Standard Segment Builder, each **Include** narrows the audience and each **+** widens it.
* In the Advanced Segment Builder, objects carry field conditions and an optional minimum frequency, and groups carry the include / exclude and `and` / `or` logic.
  {% endstep %}

{% step %}

### Check the volume before you commit

Refresh the user count and confirm the order of magnitude. Because data is indexed rather than pre-aggregated, this count is available in real time.

{% hint style="info" %}
A count of zero at this stage is a query problem. A plausible count that yields nothing downstream is a persistence problem - see the next step.
{% endhint %}
{% endstep %}

{% step %}

### Decide persistence and evaluation period

Fill in the [advanced fields](/audience-and-activation/build-your-audiences/segment-reference.md#advanced-fields) deliberately:

* **Persisted.** Ticked by default. Leave it ticked if you will activate the segment through a feed, reference it in another segment's query, use it in analytics, or export it. Untick it if you only need its stats and dashboard - persistence has a computational cost. You can change this later.
* **Evaluation period.** Default 1 day, and a maximum rather than a promise: the segment may be computed sooner depending on platform load.
* **Technical name.** Set it if an external system needs to address this segment. It must be unique across your segments.
  {% endstep %}

{% step %}

### Attach processing activities if the segment will be activated

For a Query segment, consent is enforced by adding implicit conditions to the query itself, so the processing activity has to be attached before the segment is computed. See [Enforce compliance on your audience](/audience-and-activation/build-your-audiences/enforce-compliance-on-your-audience.md).
{% endstep %}

{% step %}

### Save

Click **Save as** and name the segment. It is immediately available in **Audience > Segments**, and will be populated at the next computation.
{% endstep %}
{% endstepper %}

## Verification

* The segment appears in **Audience > Segments** with the type `Query`.
* After the first computation, the user count on the segment page is non-zero and close to the count the builder forecast.
* If the segment is persisted, feeds and dependent segments can see it. If you unticked persistence, they cannot - which is the expected behaviour, not a bug.

## Troubleshooting

<table data-search="false"><thead><tr><th width="290">Symptom</th><th>Likely cause</th></tr></thead><tbody><tr><td>The builder counts users, but a feed on the segment sends nothing</td><td>The segment is not persisted, or has not been computed yet. See <a href="/audience-and-activation/build-your-audiences/segment-reference.md#counting-is-not-persistence">Counting is not persistence</a>.</td></tr><tr><td>The count is far larger than expected</td><td>An empty parameter field in the Standard Segment Builder selects <em>every</em> value, not none. Check for unset fields.</td></tr><tr><td>The count collapsed after a schema change</td><td>A definition error alert is probably open on the segment. See <a href="/audience-and-activation/build-your-audiences/segment-reference/segment-capabilities.md#segments-that-have-a-definition-error">Alerts</a>.</td></tr><tr><td>The count is right but activation reaches few users</td><td>Identifier coverage, not segment size. See <a href="/audience-and-activation/activate-your-audiences/track-a-feed-stats-and-troubleshoot.md#the-three-numbers-that-matter">The three numbers that matter</a>.</td></tr><tr><td>You need the count as of right now, not as of last night</td><td>Query it directly. See <a href="/audience-and-activation/analyze-your-data/check-your-audience-reach-and-stats.md">Check your audience reach and stats</a>.</td></tr></tbody></table>

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Build your audience from live user activity</strong></td><td>When daily recomputation is too slow for the job.</td><td><a href="/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/build-your-audience-from-live-user-activity.md">Build your audience from live user activity</a></td></tr><tr><td><strong>Send your first-party data to a destination</strong></td><td>What to do with the segment once it is computed.</td><td><a href="/audience-and-activation/activate-your-audiences/send-your-audience-to-a-destination/send-your-first-party-data-to-a-destination.md">Send your first-party data to a destination</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/audience-and-activation/build-your-audiences/target-your-audience-based-on-criteria/compute-your-audience-from-stored-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
