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

# Dimension Tables

> Use dimension tables to segment your entities.

Dimensions describe your entities.
Use dimensions to segment your metrics into subgroups.
For example, by adding a `country` dimension to a `User` entity, you can split results into
subgroups based on the country of the user.

<Note>
  If the dimension table has a column of type timestamp, Confidence uses the dimension value from the time right before the user got exposed to the treatment.
</Note>

## Configuration

### SQL Query

You need to enter the SQL that selects your dimensions. After you've entered your
SQL, you can click **Run Query**. Confidence then executes your query with a
limit to check that everything is in order and displays a few sample rows.

### Entity

You need to specify which entity the dimensions belong to. You can
split the result of metrics for this entity into subgroups based on the
dimensions.

### Dimensions

A dimension is a value that you can use to categorize an entity. Confidence
supports static dimensions and dimensions that change over time. A typical
example is splitting a "User" entity into segments based on a "Country" which is
a static dimension, or "Used feature X the week before the experiment" which is
a time-changing dimension.

For time-changing dimensions, it's important to use dimension values before the
user got exposed to the treatment. This way, the treatment doesn't influence
the dimension value itself, which could invalidate the
exploration.

Confidence distinguishes between static and time-changing dimensions by looking for
a timestamp column in the dimension table schema. Confidence considers all
dimensions in a dimension table with a timestamp column as time-changing
dimensions.

<Note>
  Confidence uses the dimension value from the time right before
  the user got exposed to the treatment. This ensures that the dimension
  value is not influenced by the treatment itself.
</Note>

For time-changing dimensions, you need to specify what time window before
exposure to use to fetch the dimension value. If there are multiple
values in this window, Confidence uses the latest value.

#### NULL Values

Sometimes, not all users exposed to an experiment have a value in the dimension table. Add a NULL-value mapping to the dimension field to
make the lack of value render in a meaningful way in the exploration
page. You can configure the NULL-value mapping by entering a replacement in the
**Replace null with** setting for a dimension.

## Related Resources

<CardGroup cols={2}>
  <Card title="Create Dimension Tables" href="/docs/how-to-guides/create-dimension-table">
    Step-by-step dimension table guide
  </Card>

  <Card title="Explore Results" href="/docs/how-to-guides/explore-results">
    Segment results by dimensions
  </Card>

  <Card title="Fact Tables" href="/docs/metrics/fact-tables">
    Set up measurement data sources
  </Card>

  <Card title="Entities Reference" href="/docs/metrics/entities">
    Configure dimension entities
  </Card>
</CardGroup>
