A derived metric is composed of an atomic metric, a period, and one or more modifiers. A derived metric reflects the status of a business activity within a specific period and a specific scope. For example, you can use a derived metric to measure the sales amount in the last week for an enterprise in Shanghai. This topic describes how to create a single derived metric and create multiple derived metrics at a time. This topic also describes other operations related to derived metrics.

## Prerequisites

Before you create a derived metric, make sure that the operations described in the following table are performed.
Operation Description
Create an atomic metric The atomic metric is used to define a criterion and computing logic for the statistical analysis of a business activity.
Create a modifier The modifier is used to define the scope for the statistical analysis of a business activity.
Create a period The period is used to define the period of time for the statistical analysis of a business activity.
Create a dimension table The dimension table is used to define the statistical dimension of a business activity.
Create a data layer You must create a data layer based on your business requirements.
• DWS layer: The DWS layer is used to store derived metrics that are created at a common layer.
• ADS layer: The ADS layer is used to store derived metrics that are created at an application layer.
• If you want to create a derived metric at a common layer, you must create a data domain or business process. The data domain or business process is used to define the category of business data that is collected by the derived metric.
• If you want to create a derived metric at an application layer, you must create a data mart or subject area. The data mart or subject area is used to define the category of the product or scenario whose business data is collected by the derived metric.

## Background information

A derived metric collects statistical data on the status of a business activity of an enterprise. A derived metric is composed of `an atomic metric, a period, and one or more modifiers`. A derived metric can reference only one atomic metric and collects statistical data on the values of the atomic metric within a specific period based on specific business conditions.
• An atomic metric determines a criterion and computing logic for the statistical analysis of a business activity. For example, you can use the total number of orders that are placed as an atomic metric.
• A modifier defines the scope of a business activity. For example, you can use online fresh shops and offline fresh shops as modifiers.
Note A derived metric can contain one or more modifiers.
• A period defines the time range within which you want to collect statistical data. For example, you can use a calendar day as a period.
• A derived metric is composed of an atomic metric, a period, and one or more modifiers. A derived metric is used to collect statistical data on the values of an atomic metric within a specific period based on specific dimensions and business conditions. A derived metric reflects the status of a business activity of an enterprise. For example, you can create a derived metric to collect statistical data on `the total number of orders that are placed in online fresh shops on a calendar day` or ```the total number of orders that are placed in online and offline fresh shops on a calendar day```.
You can associate fields in one or more dimension tables with a derived metric. This way, you can perform statistical analysis on a business activity based on one or more dimensions. For more information about how to create a dimension table, see Create a dimension table.
This topic includes the following sections:

## Go to the Derived Metric page

1. Log on to the DataWorks console.
2. In the left-side navigation pane, click Workspaces.
3. In the top navigation bar, select the region where your workspace resides. On the Workspaces page, find the workspace and click DataStudio in the Actions column.
4. On the DataStudio page, click the icon in the upper-left corner and choose All Products > Data Modeling > Data Metric. The Derived Metric page appears.

## Create multiple derived metrics at a time

1. Select an operation type.
On the Derived Metric page, move the pointer over the icon and click Multiple Derived Metrics.
2. Create a metric model that is used to create multiple derived metrics at a time.
1. Select atomic metrics, modifiers, and periods.
Area Description
1 In this area, you can select atomic metrics, modifiers, and periods that are used to create multiple derived metrics at a time.
Note
• If the atomic metrics, modifiers, or periods that are displayed do not meet your business requirements, you can click Create to create the desired objects.
• A derived metric is composed of an atomic metric, a period, and one or more modifiers.
2 In this area, a render tree is displayed to show all derived metrics that will be created at a time. The following icons can be displayed for a derived metric:
• : indicates that the derived metric does not exist.
• : indicates that the derived metric already exists. When you create derived metrics, the system does not create an existing derived metric again.
• : allows you to copy the derived metric.
3 In this area, you can change the display mode of the render tree. For example, you can zoom in, zoom out, or center the render tree, or present the render tree in full screen.
2. Click Generate Derived Metrics.
3. Create multiple derived metrics at a time.
1. Select the created data layer and a checker.
You can select the created data layer and a checker. The checker is used to standardize the naming formats of the derived metrics.
Note If no checkers are available, you can create one in Data Warehouse Planning. For more information about how to create a checker, see Configure and use a checker at a data layer.
2. Click Next.
3. Select the derived metrics that you want to create.
1. In the Select Derived Metrics step, select the derived metrics that you want to create based on the created metric model. By default, all derived metrics in the metric model are selected.
2. Click Create or Create and Submit. The derived metrics are created at a time.
• If you click Create, the selected derived metrics are created. You must go to the configuration tabs of the derived metrics to submit the derived metrics.
• If you click Create and Submit, the selected derived metrics are created and submitted. Only submitted derived metrics can be referenced when you create tables.
After a derived metric is created, the state of the metric in the render tree changes from to .
4. In the Create Derived Metric step, view the created derived metrics.
In the Create Derived Metric step, view the status of the derived metrics.

## Create a single derived metric

1. Select an operation type.
On the Derived Metric page, move the pointer over the icon and click Derived Metric.
2. Create a derived metric.
1. Configure business logic for the derived metric.
Parameter Description
Period The period of time for which you want to perform statistical analysis for a business activity. Examples: last day and last week.
Modifier The scope for the statistical analysis of a business activity. Examples: online and offline.
Atomic Metric The atomic metric that is used to define a criterion and computing logic for the statistical analysis of a business activity. Example: order amount.
2. Configure basic information for the derived metric.
Parameter Description
Data Layer The data layer at which the derived metric is created.
Business Process The category of the business activity. This parameter is displayed and required only if you set the Data Layer parameter to Common Layer.
Mart/Subject The category of the business activity for a specific scenario or product. This parameter is displayed and required only if you set the Data Layer parameter to Application Layer.
Display Name The display name of the derived metric. You can click Intelligent Recommendation on the right side of Display Name to generate a display name in the `Period name_Modifier names_Atomic metric name` format. The generated display name can help you identify the meaning of statistical data collected by the derived metric in an efficient manner.
Note
• Intelligent Recommendation is displayed only after you specify an atomic metric and a period when you configure business logic for the derived metric.
• You can move the pointer over or click the icon and select a checker to check whether the display name of the derived metric complies with the specified naming convention. If the checkers that are displayed do not meet your business requirements, you can create one in Data Layer. For more information about how to create a checker, see Configure and use a checker at a data layer.
Name The name of the derived metric.
Description The description of the derived metric.
3. Click Save in the upper part of the configuration tab. The derived metric is created.
4. Click Submit in the upper part of the configuration tab. The derived metric is submitted. Only derived metrics that are submitted can be referenced when you create tables.
Note
• Only derived metrics that are saved can be submitted.
• Each time you submit the same derived metric, a new version is generated for the derived metric. You can submit a derived metric of a specific version only once.

## Manage versions of a derived metric and view fields associated with a metric

In the right-side navigation pane of the configuration tab of a metric, you can click Version Management and Associate Tables to manage versions of the metric and view fields that are associated with the metric.
Operation Description
Manage versions of the metric You can click Version Management to view the version information of the metric. You can also perform the following operations:
• Compare versions
You can compare the selected versions. If you select only one version for comparison, the system compares the selected version and the current settings that are saved for the metric.
Note You can select a maximum of two versions for comparison.
• Roll back settings
You can roll back the settings displayed on the configuration tab of the metric to a version that you select. After you click Roll Back in the Actions column that corresponds to a selected version, the settings displayed on the configuration tab of the metric are overwritten by the selected version.
Note The rollback operation only rolls back the settings displayed on the configuration tab of the metric to the selected version. If you want to reference the latest settings of the metric when you create a derived metric or table, save and submit the settings again.
View fields associated with the metric You can view fields that are associated with the metric. You can click View Details in the Actions column of a field that is associated with the metric to go to the details page of the table to which the field belongs. Then, you can view more information about the table on the details page.

## Export derived metrics

If you want to export multiple derived metrics at a time, you can use the export feature.
1. Go to the tab that displays the derived metric list.
In the left-side navigation tree of the Derived Metric page, double-click Derived Metric to go to the tab that displays the derived metric list. On this tab, you can view information about all derived metrics that are created.
2. Select the derived metrics that you want to export.
Note If you want to export all existing derived metrics, you can skip this step.
You can use one of the following methods to select the derived metrics that you want to export:
• Search for the desired derived metrics by keyword: You can enter a keyword in the search box to search for the desired derived metrics and select the derived metrics.
Note Fuzzy match is supported. After you enter a keyword in the search box, all derived metrics whose names contain the keyword are displayed.
• Select the derived metrics from the derived metric list: You can select the desired derived metrics from the derived metric list.
3. Export the derived metrics at a time.
You can use one of the following methods to export the derived metrics at a time:
• Export All: You can click Export All in the upper part of the tab that displays the derived metric list to export all derived metrics that are created in the current workspace.
• Export Searched Objects: You can enter a keyword in the search box to search for the derived metrics that you want to export, click the Batch Export drop-down list in the lower part of the tab that displays the derived metric list, and then select Export Searched Objects. Then, all derived metrics that are displayed after you enter the keyword in the search box are exported.
• Export Selected Objects: You can select the derived metrics that you want to export from the derived metric list, click the Batch Export drop-down list in the lower part of the tab that displays the derived metric list, and then select Export Selected Objects. Then, all derived metrics that you selected are exported.
4. View and download the export result.
After you initiate an export task, you are navigated to the Details of Export Status of Derived Metrics page. On this page, you can view the status of the export task. After the derived metrics are exported, you can click Download File to download the derived metrics that are exported.

## Delete or submit multiple derived metrics at a time

If you want to delete multiple derived metrics that are no longer required or submit multiple derived metrics that are saved, you can select the derived metrics and click the related button to delete or submit the derived metrics at a time.
1. Go to the tab that displays the derived metric list.
In the left-side navigation tree of the Derived Metric page, double-click Derived Metric to go to the tab that displays the derived metric list. On this tab, you can view information about all derived metrics that are created.
2. Select the derived metrics that you want to delete or submit.
Note Only derived metrics that are saved but not submitted can be submitted at a time.
3. Click Batch Delete or Batch Submit based on your business requirements.
• Batch Delete: After you click this button, the selected derived metrics are deleted at a time. The deleted derived metrics cannot be referenced when you create tables.
Note If a derived metric is referenced by a table, you must remove the reference relationship before you delete the derived metric.
• Batch Submit: After you click this button, the selected derived metrics are submitted at a time. After the derived metrics are submitted, they can be referenced when you create tables, and the latest versions are generated for the derived metrics. For more information about the versions of a derived metric, see the Manage versions of a derived metric and view fields associated with a metric section in this topic.

## What to do next

After a derived metric is created, you can reference the derived metric when you create an aggregate table or application table. The aggregate table or application table lays a foundation for subsequent operations such as business queries, OLAP analysis, and data distribution. For more information about how to reference a derived metric when you create a table, see Publish and manage a table.