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

# Dimension Tables

> Reference tables: agents, teams, tags, HSM templates.

# Dimension Tables

Dimensions contain reference information that you can join with fact tables using JOINs. They are updated more frequently (every 10 minutes).

***

## dim\_agents

Information about each agent registered on the platform.

| Column       | Type   | Description                        |
| ------------ | ------ | ---------------------------------- |
| `id`         | Int32  | Agent identifier                   |
| `company_id` | Int32  | Company identifier                 |
| `first_name` | String | First name                         |
| `last_name`  | String | Last name                          |
| `email`      | String | Email address                      |
| `active`     | Bool   | Whether the agent is active        |
| `agent_type` | String | Agent type: `admin`, `agent`, etc. |

***

## dim\_tags

Queues or tags used to route conversations to groups of agents.

| Column       | Type   | Description                        |
| ------------ | ------ | ---------------------------------- |
| `id`         | Int32  | Tag identifier                     |
| `company_id` | Int32  | Company identifier                 |
| `name`       | String | Tag name                           |
| `team_id`    | Int32  | Team it belongs to. `0` if no team |

***

## dim\_teams

Work teams that group tags.

| Column       | Type   | Description        |
| ------------ | ------ | ------------------ |
| `id`         | Int32  | Team identifier    |
| `company_id` | Int32  | Company identifier |
| `name`       | String | Team name          |

***

## dim\_hsm

HSM templates (WhatsApp templates) approved by Meta.

| Column          | Type   | Description                                  |
| --------------- | ------ | -------------------------------------------- |
| `id`            | Int32  | Template identifier                          |
| `company_id`    | Int32  | Company identifier                           |
| `name`          | String | Template name                                |
| `status`        | String | Status: `APPROVED`, `REJECTED`, `PROCESSING` |
| `category`      | String | Template category                            |
| `template_type` | String | Template type                                |
| `content`       | String | Template content                             |
| `provider_id`   | String | Template ID at Meta                          |

***

## dim\_agent\_tags

Relation between agents, tags, and teams. An agent can belong to multiple tags.

| Column       | Type   | Description        |
| ------------ | ------ | ------------------ |
| `agent_id`   | Int32  | Agent identifier   |
| `company_id` | Int32  | Company identifier |
| `tag_id`     | Int32  | Tag identifier     |
| `tag_name`   | String | Tag name           |
| `team_id`    | Int32  | Team identifier    |
| `team_name`  | String | Team name          |

### Example: agents with their team

```sql theme={null}
SELECT
    a.first_name,
    a.last_name,
    at.tag_name,
    at.team_name
FROM client_analytics.dim_agents a
INNER JOIN client_analytics.dim_agent_tags at ON at.agent_id = a.id
WHERE a.active = true
ORDER BY at.team_name, a.first_name
```
