> ## 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.Hierarchy.dimension_default

#### *property* Hierarchy.dimension\_default *: [bool](https://docs.python.org/3/library/functions.html#bool)*

Whether the hierarchy is the default in its [`dimension`](./atoti.Hierarchy.dimension#atoti.Hierarchy.dimension) or not.

Some UIs support clicking on a dimension (or drag and dropping it) as a shortcut to add its default hierarchy to a widget.

### Example

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

By default, the default hierarchy of a dimension is the first created one:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Product"].dimension_default
True
>>> h["Shop"].dimension_default
False
>>> h["Customer"].dimension_default
False
>>> h["Date"].dimension_default
False
```

There can only be one default hierarchy per dimension:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Shop"].dimension_default = True
>>> h["Product"].dimension_default
False
>>> h["Shop"].dimension_default
True
>>> h["Customer"].dimension_default
False
>>> h["Date"].dimension_default
False
```

When the default hierarchy is deleted, the first created remaining one becomes the default:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> del h["Shop"]
>>> h["Product"].dimension_default
True
>>> h["Customer"].dimension_default
False
>>> h["Date"].dimension_default
False
```

The same thing occurs if the default hierarchy is moved to another dimension:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Product"].dimension = "Product"
>>> h["Customer"].dimension_default
True
>>> h["Date"].dimension_default
False
```

Since Product is the first created hierarchy of the newly created dimension, it is the default one there:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> h["Product"].dimension_default
True
```
