🧊 Cube Designer
Semantic models of cube are a set of data organized by dimensions and measures. The data view aggregated by cube is a fact table: it contains one or more columns to be measured (aggregated) and also contains columns for identifying events associated with related dimension members.
The cube designer includes three sub-functions:
- Structure: Designing the physical table relationships of cube
- Calculation: Designing calculation member formulas and data preview
- Query: Self-writing query language for data query preview
Building cube
Building cube includes information from three parts besides the fact table:
- Dimensions
- Measures
- Calculated members
Creating cube
In the data table area, find the fact table to create the cube, drag it to the model area. In the pop-up window, set:
- Type: cube;
- Name: The unique technical name of the cube;
- Label: Language description of the cube;
- Table: The fact table used by the cube;
- Fields: Fields of the fact table;
- Measure: Whether it is a measure;
- Associated dimensions: Associated shared dimensions for the cube;
Click apply to create the cube and go to the cube designer interface. The detailed property list of the cube is as follows:
Property | Description | Optional Values |
---|---|---|
Name | Unique name identifier | Generally use English characters |
Label | Language description | User language |
Description | Long text description | User language |
Default Measure | Default measure used in queries without specifying measures | Measures in the cube |
Visible | Display to the user, otherwise only used for internal calculations | Default value: true , true / false |
Enabled | Enable this dataset | Default value: true , true / false |
Cache | Whether to use data cache for the dataset | Default value: true , true / false |
Fact Table | Fact table of the cube | Tables in the data source |
Dimensions
There are two ways to add dimensions to cube:
- Inline dimension
- Shared dimension
Inline dimensions are created directly in the cube interface along with the hierarchy.
Creating a New Dimension
Click the new dimension icon on the dimension (Dimensions) area header to see an additional blank line below.
Select the dimension, and in the property editing interface opened on the right, set the properties of the dimension.
The dimension's property settings are the same as in the ❄️ Dimension Designer.
Creating a New Hierarchy
Click the new icon on the dimension line to add a blank hierarchy.
Select the newly added hierarchy row, and the right property setting column will change to the property setting interface of the hierarchy.
For detailed configuration of hierarchies, refer to the property settings in ❄️ Dimension Designer - Creating Hierarchies.
Creating a New Level
Click the new icon on the dimension line to add one or more level nodes. Click on the level node to set the level properties in the property setting interface. For detailed level property settings, refer to the property settings in ❄️ Dimension Designer - Creating Levels.
Shared Dimensions
In addition to creating inline dimensions in cube, you can also add already created shared dimensions to cube.
Drag the shared dimension from the model area to the dimension area.
Select the added shared dimension to open the right property editing interface:
- Name: Unique technical name of the dimension in the cube.
- Foreign Key: Foreign key field associated with this dimension's primary key in the fact table.
The hierarchy and levels of shared dimensions cannot be edited here; you need to go to the dimension designer for editing.
Measures
Click the new measure icon on the Measures line to add a new measure.
Select this blank measure row, and the right setting column will become the measure setting interface. Enter the following information:
See the property list below
Measure Properties
Property | English Name | Description | Optional Values |
---|---|---|---|
Name | Name | Unique name identifier | Generally use English characters |
Label | Caption | Language description | User language |
Description | Description | Long text description | User language |
Field | Column | Field corresponding to the fact table field in the cube | |
Aggregator | Aggregator | Method of measure aggregation, default is "sum" | "sum", "count", "min", "max", "avg", and "distinct-count" |
Data Type | Data Type | Field data type, default is "Numeric", except "count" and "distinct-count" measures are "Integer" | "String" "Integer" "Numeric" "Boolean" "Date" "Time" and "Timestamp" |
Visible | Visible | Display to the user, otherwise only used for internal calculations | |
Formatting | Format String | ||
Measure Expression | Measure Expression | Use SQL expression to calculate measure values instead of table fields | 1. Database dialect; 2. Expression value |
Calculated Members
Calculated Members use calculation formulas to calculate the measure fields or dimension members needed for queries.
Click the new icon on the Calculated Members header to create a new calculated member.
Select the newly added calculated member row, and set the calculated member properties in the property editing interface.
Calculated Member Properties
Property | English Name | Description | Optional Values |
---|---|---|---|
Name | Name | Unique name identifier | Generally use English characters |
Label | Caption | Language description | User language |
Description | Description | Long text description | User language |
Dimension | Dimension | Dimension to which the calculated member belongs | If it is "Measures," this calculated member is a calculated measure. If it is another dimension, it is a formula member of the dimension |
Hierarchy | Hierarchy | When a dimension is selected as a non-Measures dimension, select a hierarchy to which a formula member belongs | Hierarchy under the dimension |
Parent Member | |||
Visible | Visible | Whether visible to the user | |
Data Type | Data Type | Data type | |
Formula | Formula | Formula of the calculated member | |
Property | Property | Such as "DATATYPE", "SOLVE_ORDER" |
Structure
You can design the association of fact tables for cube, currently supporting only one fact table. The ER diagram of the cube is displayed in a star-shaped manner, with the dimensions, measures, and calculated measures of the cube in the center, and the dimension nodes around it.
Users can select cube, dimensions, or level fields to edit their property details in the property panel. The dimensions shown in the ER diagram include shared dimensions and inline dimensions. Users can click on the share icon in the upper right corner of the shared dimension node to navigate to the shared
dimension page to view its detailed information.
Calculation
The calculation interface can edit calculation member formulas and preview data for dimensions and measures.
Click the edit button of the calculation member to go to the corresponding calculation page. Edit the calculation member formula in the editor.
Drag dimensions, measures, or calculated members to rows, columns, or filters in the preview area. You can see the corresponding preview data results on the right, helping users verify the correctness of the design of cube and calculation member formulas.
- Manual Refresh: When enabled, data will only be re-queried when the refresh button is manually clicked.
- Refresh Button: Manually refresh preview data.
- Transpose Button: Swap row and column configurations to transpose the preview data rows and columns.
Query
The query interface allows users to write query statements to query cube and verify the correctness of the designed results.
- MDX Model: Queries are only effective after the model is saved.
- SQL Model: Currently, only raw physical tables can be queried, and cube cannot be queried directly.