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

# Add custom dimension configuration

> How to customize the cube schema in Atoti Limits by adding or modifying dimensions, hierarchies, levels, and datastore fields, including adding new stores and references, using Spring beans imported via LimitsAppConfig

## Overview

This section explains how to customize the cube’s schema. You can add, remove, or modify fields from new or default stores by creating specific Beans and importing them into `LimitsAppConfig.class`.

> [!NOTE]
>
> Any customizations to the default schema may cause issues with the default cube configuration.

## Customize the schema selection

### 1. (Optional) Modify the schema selection description

You can only turn fields that are already in the schema selection into levels.

> [!NOTE]
>
> The cube selection is created by retrieving all fields from a datastore, so adding an extra field to an existing store will also add it to the selection. Only fields in new datastores need a change on the selection.

You can add fields to the schema selection by creating a Spring Bean with type `UnaryOperator<CanUseOtherReference>`.

For example:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
  @Bean
  UnaryOperator<ISelectionDescriptionBuilder.CanUseOtherReference> extraSchemaSelections() {
    return builder -> builder.usingReference(TARGET_STORE_TO_DESTINATION_STORE_REFERNCE).withAllFields();
  }
```

> [!NOTE]
>
> Depending on the new store being added, fields may need to be excluded from the selection to avoid a conflict.

### 2. Add new dimensions, hierarchies, and levels

You can now turn the field in the schema selection into a level in the cube.

Dimensions, hierarchies, and levels can be added to the cube configuration by creating Spring Beans with type `DimensionsAdder`.

For example:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
 /**
   * Adds a dimension to the datastore
   *
   * @return The dimension adder
   */
  @Bean
  @Order(50)
  public ICanStartBuildingDimensions.DimensionsAdder dimensions() {
    return builder ->
        builder.withDimension(DESTINATION_DIMENSION).withHierarchyOfSameName().withLevelOfSameName();
  }
```

> [!NOTE]
>
> The order has been set to 50 so that this dimension is added after the existing dimensions (order=20) and before the epoch dimension (order=99).

### 3. Import the Spring Bean

Once the bean is created, import it into the project. See [Import Spring beans into the project](../../extend#import-spring-beans-into-the-project) on how to do this. Once done,
Spring will use the custom bean when configuring the schema.
