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 payment amount to perform statistical analysis on 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.

## 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```.
This topic contains the following sections:

## Create an atomic metric

1. Go to the Atomic 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 the desired 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. In the left-side navigation pane of the Data Modeling page, click Atomic Metric to go to the Atomic Metric page.
2. Create an atomic metric.
1. On the Atomic Metric page, click the icon to create an atomic metric.
3. Configure information for the atomic metric.
1. Configure basic information for the atomic metric.
Parameter Description
Business Process The business process to which the atomic metric belongs. The business process specifies the business activity on which you want to collect statistical data.
Abbreviation The abbreviation for the name of the atomic metric. The abbreviation is the unique identifier of the atomic metric and cannot be modified after you create the atomic metric.
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 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 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```.

Description The description of the atomic metric.
2. Configure computing logic for the atomic metric.
The 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.
Parameter Description
Metric Source The table and field based on which the atomic metric is calculated. The table is a fact table or dimension table, and the field belongs to the table.
Function The function that you want to use to calculate 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 set Data Unit to Yuan (RMB), 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. For more information, see Measurement unit.
Deduplication Specifies whether to remove duplicate data during statistical data collection. 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 versions of an atomic metric and view fields associated with an atomic 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.

## 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 that can be used to import atomic metrics. You can specify the required information about 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. In the Import dialog box, configure the Import Mode parameter, download the template file, specify the required information about atomic metrics in the file, and then upload the file.
1. Ignore Existing Objects with Same Name is the only value of the Import Mode parameter.
The value is selected by default and cannot be changed.
2. Configure the Import Status parameter based on your business requirements. After the atomic metrics are imported, the system saves or submits the atomic metrics based on the value that is specified for the Import Status parameter.
4. In the downloaded template file, specify information such as Business Process, Display Name, and Abbreviation for atomic metrics and save the file.
Note If you cannot edit the template file after you download it, click Start Edit in the upper part of the template file.
5. Click Select File. Then, select the template file that you saved and click OK.
You can view the import result and details in the Import dialog box.

## 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. 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.
2. 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 versions of an atomic metric and view 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 about how to reference an atomic metric when you create a derived metric or table, see Derived metric and Field management: Configure attributes and associations for fields in the table.