A derived metric collects statistics about a business activity within a specific period. This makes it unsuitable for data comparisons, such as calculating business growth rates or value differences. For example, you cannot use a derived metric to calculate the week-over-week growth rate for a business activity. To address this limitation, DataWorks provides composite metrics. A composite metric is created by applying computing logic to one or more derived metrics. This lets you define business metrics with more flexibility and detail. This topic describes how to create and use composite metrics.
Prerequisites
-
You have created the derived metrics required for your composite metric. For more information, see Create a derived metric.
-
You have created a data layer to store the composite metric. You must select the appropriate layer based on your requirements. For more information, see Define data warehouse layers.
-
Data Warehouse Summary (DWS) layer: Stores composite metrics for the common layer.
-
Application data layer: Stores composite metrics for the application layer.
-
-
You have created a business process, data mart, or subject area, which is required to categorize the composite metric for a specific scenario or product. The requirements depend on the data layer of the composite metric:
-
Composite metric (common layer): A business process is required. For more information, see Business Process.
-
Composite metric (application layer): A data mart or subject area is required. For more information, see Data Mart or Subject Area.
-
Go to the composite metric page
-
Go to Data Modeling.
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Modeling.
-
On the Data Modeling page, click Data Metrics in the top navigation bar to go to the Composite Metric page.
Create a composite metric
The Basic Information section includes parameters such as Data Warehouse Layers, Business Category, Business Process, Abbreviation, Chinese Name, and Owner.
In the upper-right corner of the composite metric list, click
to create a new composite metric. The key configurations are as follows:
-
Computing Logic
DataWorks provides two methods to define the computing logic for a composite metric:
-
Expression: This method lets you define a custom expression based on your business requirements. You can reference derived metrics or other composite metrics using the at sign (@).
-
Comparison: This method is used only to calculate year-over-year changes or sequential changes between consecutive periods. You can select the derived metric and the comparison period.
-
-
Basic Information
Create a composite metric for the common layer or application layer based on your business needs. Follow the on-screen instructions to select the business scope for the metric. The actual configuration on the UI may vary.
After you create the metric, you must save and commit the current version. Only committed composite metrics can be referenced by other metrics.
-
Only saved composite metrics can be committed.
-
A successfully committed version cannot be re-committed.
Version management
You can view and manage metric versions in the right-side navigation pane of the metric editing page. The version management pop-up window contains a version list that displays the Version Number, Committer, Commit Time, and Actions columns for each version. An Associated Tables tab is also available on the right.
-
Version Comparison
Compare the content of selected versions.
-
If you select only one version, it is compared with the currently saved metric content.
-
You can select a maximum of two versions for comparison.
-
-
Roll Back
Roll back to a specific metric version. After the rollback, the content on the metric editing page is replaced by the content of the target version.
NoteThe rollback operation only updates the UI configuration to the selected version. If you want models and derived metrics to reference the rolled-back configuration, you must save and commit the changes again.
Batch operations
Click
in the upper-right corner of the composite metric tree to switch to the list view. You can select multiple metrics and perform the following batch operations:
-
Batch Export: You can export metrics in one of the following three ways.
-
Export All: Export all composite metrics in the current workspace.
-
Export Searched Objects: Exports all metrics that match your search query.
NoteFuzzy search is supported. When you enter a keyword, the search returns all composite metrics whose names contain that keyword.
-
Export Selected Objects: Export all selected metrics.
After the export is complete, you can download the exported file to your computer.
-
-
Batch Delete or Batch Submit
If you have multiple obsolete metrics or need to commit multiple newly created metrics in a batch, you can perform these operations from the composite metric list.
-
Batch Delete: Deleted metrics can no longer be associated with or referenced by model tables. If a metric is already referenced by a model table, you must remove the reference before you can delete the metric.
-
Batch Submit: Committed metrics can be associated with and referenced by model tables. Each commit generates a new version record. For more information about metric versions, see version management.
-