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. UseManyToOneRelationship with the join path from the fact table:
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, useManyToManyRelationship. Map fields from the dimension table to existing levels:
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, useNoRelationship:
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.- 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:- Provide a calculator function that receives an
IArrayReaderand 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:- 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:Dimension1 to DimensionA, Level1 to LevelA, and so on.
Related pages
- Create measures: measure definitions and aggregations