All Products
Search
Document Center

DataWorks:Derived metric

Last Updated:Feb 01, 2024

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, such as viewing the versions of a derived metric, viewing the fields associated with a derived metric, exporting derived metrics, and deleting a derived metric.

Prerequisites

Preparation

Description

An atomic metric is created.

The atomic metric is used to define a criterion and computing logic for the statistical analysis of a business activity.

A modifier is created.

The modifier is used to define the scope for the statistical analysis of a business activity.

A period is created.

The period is used to define the period of time for the statistical analysis of a business activity.

A dimension table is created.

The dimension table is used to define the statistical dimension of a business activity.

A data layer is created.

You must create a data layer based on your business requirements.

  • Data warehouse summary (DWS) layer: The DWS layer is used to store derived metrics that are created at a common layer.

  • Application data service (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 for 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.

Go to the Derived Metric page

  1. Log on to the DataWorks console. In the left-side navigation pane, choose Data Modeling and Development > Data Modeling. On the page that appears, select the desired workspace from the drop-down list and click Go to Data Modeling.

  2. In the top navigation bar of the Data Modeling page, click Data Metric. The Derived Metric page appears.

    You can create a derived metric at a common layer or an application layer based on your business requirements. In addition, you can choose to create a single derived metric or create multiple derived metrics at a time.

    In most cases, the business activities of an enterprise are complex and diverse, and the status of multiple business activities within different periods and scopes needs to be analyzed at the same time. We recommend that you create multiple derived metrics for one type of business activity at a time. For information about how to create multiple derived metrics at a time, see the Create multiple derived metrics at a time section in this topic. For information about how to create a single derived metric, see the Create a single derived metric section in this topic.

Create multiple derived metrics at a time

  1. Select an operation type.

    In the Derived Metric pane, 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 a data layer and a checker.

      In the Generate Derived Metrics dialog box, select a data layer and a checker based on your business requirements. 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.

      You can view information about the created derived metrics in the derived metric list.

Create a single derived metric

  1. Select an operation type.

    In the Derived Metric pane, move the pointer over the 新建 icon and click Derived Metric.

  2. Create a derived metric.

    1. Configure business logic.

      Configure the parameters listed in the following table based on your business requirements.

      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.

      You can create a derived metric at the DWS layer or ADS layer based on your business requirements. The following table describes the basic information that you can configure.

      Parameter

      Description

      Data Layer

      The data layer at which the derived metric is created.

      Business Category

      The business category to which the derived metric belongs. A business category can be associated with a data domain or data mart.

      This parameter is displayed and required only if you set the Data Layer parameter to Common Layer.

      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 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 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 at the related data layer. For more information about how to create a checker, see Configure and use a checker at a data layer.

      Abbreviation

      The abbreviation for the name of the derived metric. You can click Intelligent Recommendation on the right side to generate an abbreviation in the Period name_Modifier names_Atomic metric name format. The generated abbreviation 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 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 at the related 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.

      Owner

      The owner of the derived metric. The default owner is the creator 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 the versions of a derived metric and view the fields associated with a derived metric

In the right-side navigation pane of the configuration tab of a metric, you can click Version Management to manage the versions of the metric, and can click Associate Tables to view the fields that are associated with the metric.其他操作

Operation

Description

Manage the 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 the fields associated with the metric

You can view the 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 Derived Metric pane, click the image.png icon 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 desired derived metrics from the derived metric list: You can directly 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 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, and then select Export Searched Objects. Then, all atomic metrics that are displayed in the search result are exported.

    • Export Selected Objects: You can select the derived metrics that you want to export, click the Batch Export drop-down list in the lower part of the tab, 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 Derived Metric pane, click the image.png icon 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. Then, 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 the versions of a derived metric and view the fields associated with a derived metric section in this topic.

What to do next

After the 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 materialize a table.