Skip to main content
Dimensions and hierarchies define the structure users navigate when querying the cube. A hierarchy organizes members into one or more levels, and a dimension groups related hierarchies and specifies how their members relate to the fact table. Understanding dimension types helps choose the right approach for the data model and optimize query performance.

Prerequisites

Before creating dimensions and hierarchies, make sure:
  • A cube is created (see configure cubes)
  • The relationships between tables are understood

What are the dimension types?

There are two distinct dimension types:

How to create dimensions from a table

When creating a dimension from a table, specify the relationship between the base or fact table and the dimension table.

When to use many-to-one relationships

A many-to-one relationship means multiple rows in the fact table map to a single row in the dimension table (e.g., multiple trades reference the same product, or multiple orders belong to the same customer). Many-to-one relationships are the most common case. Use ManyToOneRelationship with the join path from the fact table:
Then add hierarchies to the dimension:
If no relationship is specified, the configurator searches for a unique many-to-one relationship automatically:

When to use many-to-many relationships

A many-to-many relationship means a single row in the fact table can map to multiple rows in the dimension table (e.g., a trade with multiple counterparties, or a product belonging to multiple categories). For many-to-many relationships, use ManyToManyRelationship. Map fields from the dimension table to existing levels:
Many-to-many dimensions are computed at query time and cannot be used in PreAggregators.

When to use no-relationships

Tables that are not related to the fact table can be used as dimensions. This is useful for reference data. For dimensions not related to the fact table, use NoRelationship:

When to use virtual hierarchies

Virtual hierarchies do not store their members. They consume less memory but have limited features. For more information, see virtual hierarchies.
Use virtual hierarchies for:
  • Very large dimensions where member enumeration is not needed
  • Dimensions that do not require member-based filtering

How to create custom hierarchies

Custom hierarchies are not directly loaded from the dimension table. They can be created manually or derived from other dimensions.

When to create derived hierarchies

Derived hierarchies can be used as bucketing hierarchies. Compute members by applying a transformation to other cube elements:
Key points:
  • Provide a calculator function that receives an IArrayReader and returns the bucket value
  • Specify the underlying cube items (levels or measures)
  • Optionally specify valid members with withMembers()

How to create manual hierarchies

Manual hierarchies have an explicitly defined set of members:
Use manual hierarchies for:
  • Fixed member sets
  • Analysis dimensions not related to data
  • Custom categorizations

How to update dimension, hierarchy or level metadata

Once a dimension, hierarchy, or level is defined, only metadata can be changed. Metadata includes visibility, folder location, and formatting:

How to rename cube elements

Renaming applies when working with a predefined configuration.

How to rename elements with YAML

Add name overrides in the application configuration file:
This configuration renames Dimension1 to DimensionA, Level1 to LevelA, and so on.