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

# atoti.Dimension

<span id="atoti.Dimension" />

Dimension of a [`Cube`](./atoti.Cube#atoti.Cube).

A dimension is a group of related [`hierarchies`](./atoti.Hierarchy#atoti.Hierarchy).

For example, the hierarchies **Currency**, **Date**, and **Trader Location** could be grouped into the **Trades** dimension.

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> table = session.create_table(
...     "Sales", data_types={"Product": "String", "Shop": "String"}
... )
>>> cube = session.create_cube(table, mode="manual")
>>> d, h = cube.dimensions, cube.hierarchies
>>> h["Product"] = [table["Product"]]
>>> h["Shop"] = [table["Shop"]]
>>> dimension = d["Sales"]
```

Iterating on a dimension lists the names of its hierarchies:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> len(dimension)
2
>>> list(dimension)
['Product', 'Shop']
```

A specific hierarchy can be retrieved by name:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> dimension["Product"].name
'Product'
```

<Callout icon="link">
  **See also**:
  [`Dimensions`](./atoti.Dimensions#atoti.dimensions.Dimensions) to define one.
</Callout>

|                                                                                              |                                         |
| -------------------------------------------------------------------------------------------- | --------------------------------------- |
| [`default_hierarchy`](./atoti.Dimension.default_hierarchy#atoti.Dimension.default_hierarchy) | The default hierarchy of the dimension. |
| [`description`](./atoti.Dimension.description#atoti.Dimension.description)                   | Description of the dimension.           |
| [`name`](./atoti.Dimension.name#atoti.Dimension.name)                                        | Name of the dimension.                  |
