Managing Dimension Definitions¶
You can create a new dimension definition on the dimension definition tab of the dimension table page, and edit and publish the dimension definition.
Prerequisites¶
Before you start, ensure the following:
The current account has been assigned a menu group including Dimensions. If not assigned, contact the application administrator.
When you select
Data Source Registration
as your data connection type, you need to ensure that the configuration of the data source has been completed in Data Source Registration.
Creating a Dimension Definition¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
In Dimension Definition tab, select New to go to the New Dimension page.
Enter the following Basic Information:
Dimension ID: Enter the unique ID for the dimension table under the current OU.
Dimension Name: Enter a name for the dimension table.
Data Connection Type: Select
Data Source Registration
orNone
.Select
Data Source Registration
, select the data source type and data source name, then define the location where the dimension table is stored and the data source in the dimension table.Select
None
, after which you can configure data for the attributes in the dimension table by calling the Open API.
Select Data Source: Select the data source type and the name of the data source registered under this type.
Description: Enter a description for the dimension table.
Enter the following Logic Information:
Dimension Attribute: Configure attributes for the dimension. For example, the country name, country ID, or province name in the geographic dimension are dimension attributes. Among them,
guid
is an attribute that is automatically displayed every time a dimension table is created. Attributes can be added by selecting the duplicate button or by selecting Add.
Field
Description
Attribute ID
The custom attribute ID must be unique in the current dimension table. This attribute can be understood as the header of the dimension table and must start with a lowercase letter.
Description
Enter a description of the attribute to help identify it and make its use clear.
Data Type
The type of the attribute value.
Primary Key
The primary keys have no business meaning and their value is required. The data type of the attribute set as a primary key is
STRING
. Set one or more attributes as the primary key(s) in sequence starting at 0 (the primary key numbered 0 can be treated as the first column of the dimension table), and the primary keys can all be associated with the foreign keys of a fact table. For example, in the device dimension table, the device ID is used as a primary key to find all other attributes of the device. In the corresponding fact table, there is also the same device ID, which allows the dimension table to be linked with the fact table.Primary Key Name
The primary key name refers to the display name of the primary key. It is used together with the primary key of the same sequence number to query data accurately and quickly. For example, if the device data of multiple OUs are contained in the same dimension table and each device of the OU is unique, the target device can be found using both the
OU ID
set as the primary key and theDevice ID
set as the primary key name. Multiple attributes can be set as display names for multiple primary keys in a dimension table, but the number of primary key names must be less than or equal to the number of primary keys. For example, ifcountryid 0
,provinceid 1
, andcityid 2
are set as primary keys,provincename 1
andcityname 2
can be set as primary key names ofprovinceid 1
andcityid 2
.Not null
If data of the attribute is not null, the attribute value is required when configuring the data mapping, otherwise the metric query is affected.
Dimension Hierarchy: Multiple attributes in a dimension table are sometimes related to each other in a hierarchy. If there is a hierarchical relationship between dimensions, you can select Add, fill in the dimension hierarchy in the pop-up window and add it, and then you can aggregate and drill down metric data by the dimension hierarchy.
Hierarchy Id: Enter a hierarchy ID. Must be unique in the current dimension table.
Hierarchy Name: Enter a hierarchy name.
Hierarchy Type: Select a hierarchy type. The hierarchy types are explained in the table below.
Hierarchy Type
Meaning
Example
Related Operations
Standard Hierarchy
Data can be divided into multiple hierarchies, showing a tree structure. This type of hierarchy is generally used for data with a relatively fixed number of hierarchies.
The hierarchy of a wind turbine group is divided into continents, countries, and regions according to geographical regions(see Figure 1).
Select added dimension attributes as the ID and Name of the hierarchy.
The order of the hierarchies can be adjusted by dragging.Parent-Child Hierarchy
The data is divided into 2 hierarchies, and there is a parent-child relationship between the two hierarchies. This type of hierarchy is generally used for data with an unfixed number of hierarchies. For example, the geographic dimension can generally be divided into country - province - city - county/administrative district, but for Shanghai, as a municipality directly under the Central Government, there is no province hierarchy. By using this parent-child hierarchies to divide data can avoid situations where some data cannot be aligned to a fixed hierarchy after using a standard hierarchy.
For the geographic dimension, you can set the following dimension attributes: ID, name, parent node ID. Parent node ID can be used to locate the parent hierarchy. The generated dimension table is shown in Figure 2.
Enter the IDs and names of the Parent Level Fields and Child Level Fields.
Figure 1:
Figure 2:
Note
The same attribute ID can be reused in different dimension hierarchies under the current dimension.
Extra Attributes: You can add additional information for the dimension table which has nothing to do with dimension attributes and will not be stored in the dimension table. For example, the creator of the dimension table, the creation time of the dimension table, and the domain to which the dimension table belongs.
Select Publish to save and publish the dimension definition.
If you don’t want to publish the dimension definition for the moment, you can Save it as a draft. To publish it later, see Publishing a Dimension Definition.
After saving or publishing the dimension definition for the current dimension table, you can view it in the list on the dimension definition tab.
Editing a Dimension Definition¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Select Edit at the end of the row in the target dimension table, and then save or publish the changes.
Deleting a Dimension Definition¶
To delete a dimension definition, make sure you have deleted the dimension configuration associated with the dimension definition in advance. To delete a dimension configuration, see Deleting a Dimension Configuration.
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Select Delete after hovering over the ellipsis (…) at the end of the target dimension table row.
Publishing a Dimension Definition¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Dimension definitions can be published in the following two ways:
Select Publish at the end of the target dimension table row.
Check multiple dimension tables to publish and select Publish at the top of the page to publish dimension definitions in batches.
After the dimension definition is published, the dimension can be configured on the Dimension Configuration tab.
Unpublishing a Dimension Definition¶
To unpublish a dimension definition, ensure that the dimension configuration associated with the dimension definition has been deleted in advance. To delete a dimension configuration, see Deleting a Dimension Configuration.
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Select Unpublish at the end of the target dimension table row to unpublish the dimension definition.
Viewing an Online Version of a Dimension Definition¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Hover the mouse over the ellipsis (…) at the end of the target dimension definition row for which the status is Updated for Publish, and then select View Online Version to view the dimension definition in its most recently modified version.
Reverting a Dimension Definition to an Online Version¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Hover the mouse over the ellipsis (…) at the end of the target dimension definition row for which the status is Updated for Publish, and then select Revert to Online Version to republish the previous dimension definition.