All Products
Search
Document Center

DataWorks:Atomic metric

Last Updated:Nov 14, 2024

Atomic metrics are created based on business activities that are performed by users. Business activities are also known as business processes. You can use atomic metrics to perform statistical analysis on business activities. Each atomic metric defines a criterion and computing logic for the statistical analysis of a business activity. For example, you can create an atomic metric to perform statistical analysis on the payment amount of a purchase business activity. This topic describes how to create a single atomic metric or create multiple atomic metrics at a time. This topic also describes other operations related to atomic metrics.

Prerequisites

A business process is created. The business process is used to determine the business activity on which statistical analysis needs to be performed. For more information about how to create a business process, see Business process.

Background information

Metrics collect statistical data on the business characteristics of an enterprise. A metric reflects the status of a business activity. Metrics are classified into atomic metrics and derived metrics. Derived metrics are related to modifiers and periods. A derived metric is composed of an atomic metric, a period, and one or more modifiers.派生指标

  • 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.

Create an atomic metric

  1. Go to the Atomic Metric page.

    1. Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose Data Development and Governance > 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.

    3. In the left-side navigation pane of the Data Metric page, click Atomic Metric. The Atomic Metric page appears.

  2. Create an atomic metric.

    1. On the Atomic Metric page, click the 新建 icon to create an atomic metric.

  3. On the configuration tab that appears, configure information for the atomic metric.

    1. In the Basic Information section, configure the parameters.

      The following table describes the parameters.

      Parameter

      Description

      Abbreviation

      The abbreviation for the name of the atomic metric. The abbreviation is the unique identifier of the atomic metric and cannot be changed after the atomic metric is created.

      Name

      The name of the atomic metric.

      We recommend that you use a name that can help you quickly identify the type of statistical data collected by the atomic metric.

      Display Name

      The display name of the atomic metric.

      We recommend that you use a display name that can help you quickly identify the type of statistical data collected by the atomic metric.

      Effective Scope

      The statistical criterion of the atomic metric. This parameter helps clarify the effective scope of the atomic metric.

      For example, if you create an atomic metric named payment amount for the business process order placing, the statistical criterion of the atomic metric can be the total amount paid by users by using different payment methods after the users place orders and coupons are deducted.

      Business Category

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

      Business Process

      The business process to which the atomic metric belongs. A business process specifies the business activity on which you want to collect statistical data.

      Owner

      The owner of the atomic metric. The default value of this parameter is the creator of the atomic metric.

      Description

      The description of the atomic metric.

    2. In the Computing Logic section, configure the parameters.

      Computing logic defines the computing method and measurement unit used for the atomic metric in subsequent operations. You must write computing code for the atomic metric based on the computing logic. The following table describes the parameters that you need to configure for the computing logic.

      Parameter

      Description

      Function

      The function that you want to use for the atomic metric.

      Decimal Places

      The number of decimal places after the decimal point. The number of decimal places is determined based on the measurement unit that you specify. For example, if you want to collect statistical data on payment amount and you select Yuan (RMB) as a measurement unit, the value of this parameter is 2.

      Data Unit

      The measurement unit determined based on the type of statistical data that you want to collect. For example, if you want to collect statistical data on payment amount, you can set this parameter to Currency Unit.

      Note

      If the measurement units that are provided do not meet your business requirements, you can create the desired measurement unit on the Measurement Unit page. For more information, see Measurement unit.

      Deduplication

      Specifies whether to remove duplicate data during the collection of statistical data. For example, if you create an atomic metric to collect statistical data on the number of VIPs, set this parameter to Yes to remove duplicate data.

  4. Click Save in the upper part of the configuration tab.

  5. Click Submit in the upper part of the configuration tab to submit the atomic metric. Only atomic metrics that are submitted can be referenced when you create derived metrics and tables.

    Note
    • Only atomic metrics that are saved can be submitted.

    • Each time you submit the same atomic metric, a new version is generated for the atomic metric. You can submit an atomic metric of a specific version only once.

Manage the versions of an atomic metric and view the fields associated with an atomic 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 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.

Import atomic metrics

If you want to create multiple atomic metrics, you can upload a file from your on-premises machine to import the atomic metrics. DataWorks provides a template for you to import atomic metrics. You can configure the required information about the atomic metrics in the template file and import the file.

  1. On the Atomic Metric page, move the pointer over the 导入 icon and click Import from Excel.

    You can refer to the steps that are described in the preceding section to go to the Atomic Metric page.

  2. Select an import object type and download an import template.

    In the Confirm Import Type step, select an import object type, download the required import template, and then configure information in the import template based on your business requirements.

    Note

    After you select the required import object type, you can preview the fields in the import template and prepare the related configuration information.

    导入原子指标

  3. Import the object information and check the information.

    In the Data Import step, upload the import template and preview the information in the import template. You can select Preview Only Objects with Same Name to preview only fields that are named the same as the existing fields in Data Modeling. You can also modify or delete the fields in the import template.

    Note
    • The value of Import Mode and that of Import Status vary based on the import object type that you selected.

      • Import Mode: This parameter determines how to process the objects that are named the same as existing objects in Data Modeling during the import process. If you select Skip, the system skips the objects. If you select Overwrite, the system overwrites the existing objects with the new objects.

      • Import Status:

        • Import and Save: Save the objects without new versions generated for the objects after the objects are imported.

        • Import and Submit: Submit the objects after the objects are imported. After the objects are submitted, new versions are generated for the objects.

    • You can use the import feature to import only a file in the .xlsx format. The file can contain a maximum of 30,000 rows and cannot exceed 10 MB in size.

    导入原子指标

  4. View the import results.

    In the OK step, view the import results. In the Details of Import Results section, you can find an atomic metric that is imported and click View More Details in the Actions column to go to the configuration tab of the atomic metric and perform operations on the atomic metric. If Failed is displayed in the Status column of an atomic metric, move the pointer over Error Logs in the Actions column to view the error message, and import the atomic metric again.

Export atomic metrics

If you want to export multiple atomic metrics at a time, you can use the export feature.导出原子指标

  1. Go to the tab that displays the atomic metric list.

    In the Atomic Metric pane, click the Lists icon in the upper part of the pane to go to the tab that displays the atomic metric list. On the tab, you can view information about all atomic metrics that are created in the current workspace.

  2. Select the atomic metrics that you want to export.

    Note

    If you want to export all existing atomic metrics, you can skip this step.

    You can use one of the following methods to select the atomic metrics that you want to export:

    • Search for the desired atomic metrics by keyword: You can enter a keyword in the search box to search for the desired atomic metrics and select the atomic metrics.

      Note

      Fuzzy match is supported. After you enter a keyword in the search box, all atomic metrics whose names contain the keyword are displayed.

    • Select the desired atomic metrics from the atomic metric list: You can directly select the desired atomic metrics from the atomic metric list.

  3. Export the atomic metrics.

    You can use one of the following methods to export the atomic metrics at a time:

    • Export All: You can click Export All in the upper part of the tab that displays the atomic metric list to export all atomic metrics that are created in the current workspace.

    • Export Searched Objects: You can enter a keyword in the search box to search for the atomic 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 atomic 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 atomic 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 Atomic Metric page. On this page, you can view the status of the export task. After the atomic metrics are exported, you can click Download File to download the atomic metrics that are exported.

Delete or submit multiple atomic metrics at a time

If you want to delete multiple atomic metrics that are no longer required or submit multiple atomic metrics that are saved, you can select the atomic metrics and click the related button to delete or submit the atomic metrics at a time.批量删除及提交

  1. Go to the tab that displays the atomic metric list.

    In the Atomic Metric pane, click the Lists icon in the upper part of the pane to go to the tab that displays the atomic metric list. On the tab, you can view information about all atomic metrics that are created in the current workspace.

  2. Select the atomic metrics that you want to delete or submit.

    Note

    Only atomic 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 atomic metrics are deleted at a time. The deleted atomic metrics cannot be referenced when you create derived metrics and tables.

      Note

      If an atomic metric is referenced by a derived metric or table, you must remove the reference relationship before you delete the atomic metric.

    • Batch Submit: After you click this button, the selected atomic metrics are submitted at a time. After the atomic metrics are submitted, they can be referenced when you create derived metrics and tables, and the latest versions are generated for the atomic metrics. For more information about the versions of an atomic metric, see the Manage the versions of an atomic metric and view the fields associated with an atomic metric section in this topic.

What to do next

After an atomic metric is created, you can reference the atomic metric when you create a derived metric or table. The derived metric can be used to collect statistical data on the values of the atomic metric within a specific period based on specific dimensions and business conditions. For more information, see Derived metric and Materialize a table to a compute engine.