An atomic metric defines the statistical criteria and calculation logic for a business activity. You can create atomic metrics based on business processes to measure a specific business activity. For example, if the business activity is a purchase, the atomic metric can be the payment amount. This topic describes how to create atomic metrics.
Prerequisites
A data domain and a business process must be created to define a specific business activity for statistical analysis. For more information, see Business planning.
Function introduction
An atomic metric is the smallest unit of measure in intelligent data modeling. It is used for the quantitative calculation of a business behavior. It defines "what to calculate" and "how to calculate".
An atomic metric consists of two parts:
Basic information: Defines the basic information and business definition of the metric. It is usually a numeric field in a fact table. For example,
amt(amount).Calculation logic (Aggregation Function): Defines the calculation method. For example,
SUM(summation),COUNT(count),AVG(average),MAX(maximum), andMIN(minimum).
Its core feature is that it is indivisible. Its definition does not contain any business filters, such as periods or channel sources. It is the foundation for building derived metrics and compound indicators.
Create an atomic metric
Go to the Atomic Metric page.
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, select the desired workspace from the drop-down list and click Go to Data Modeling.
On the Intelligent Data Modeling page, click Data Metric in the top navigation bar.
In the navigation pane on the left of the Data Metric page, click Atomic Metric to open the Atomic Metric page.
Create an atomic metric.
On the Atomic Metric page, click the
icon to create a new atomic metric.
Configure the atomic metric.
Configure basic information.
Configure the basic information for the atomic metric as described in the table below.
Parameter
Description
Abbreviation
The abbreviation of the atomic metric. It is the unique identifier of the metric and cannot be changed after creation.
Name
The English name of the atomic metric.
Use the English term for the value that the metric measures. This helps you quickly understand the statistical type of the metric.
Display Name
The Chinese name of the atomic metric.
Use the Chinese term for the value that the metric measures. This helps you quickly understand the statistical type of the metric.
Effective Scope
The statistical definition of the business activity measured by the atomic metric. This prevents ambiguity during statistical analysis.
For example, the business definition of Actual Order Payment Amount can be
The total amount paid by users through payment channels after an order is generated. This amount is the total sum actually paid by the user after all coupon discounts are deducted.Business Category
A business category can be associated with a data domain or a data mart.
Business Process
The business process to which the atomic metric belongs. It specifies the business activity for statistical analysis.
Owner
The owner of the atomic metric. By default, this is the user who creates the atomic metric.
Description
The description of the atomic metric.
Configure the calculation logic.
The calculation logic defines only the calculation method and unit for the atomic metric. In practice, you must write code based on the defined calculation logic to perform the actual calculation. The following table describes the parameters.
Parameter
Description
Function
Select the function to use for the metric calculation.
Decimal Places
The number of decimal places, determined by the selected measurement unit. For example, if you measure the payment amount in yuan, set the number of decimal places to 2.
Data Unit
Select a suitable measurement unit based on the statistical data type of the atomic metric. For example, to measure the payment amount, you can select Currency Unit.
NoteIf no existing unit types meet your business requirements, go to the measurement unit page to create one. For more information, see Measurement unit.
Deduplicate
Specify whether to remove duplicates during statistical analysis based on your business needs. For example, if the atomic metric is the number of members, you must remove duplicates instead of simply summing them up.
Click Save.
Click Submit to publish the current version of the atomic metric. Atomic metrics must be submitted before they can be referenced by models or derived metrics.
NoteOnly saved atomic metrics can be submitted.
Each submission of an atomic metric generates a new version. A successfully submitted version cannot be submitted again.
Manage versions and associated tables
In the right-side navigation pane of the metric editing page, you can also manage metric versions or view associated tables.
Operation | Description |
Version Management | View all version information for the metric. You can also perform the following operations:
|
Associate Tables | View the model table fields associated with the metric. Click View Details next to a field to go to the model table details page for more information. |
Import atomic metrics
To create many atomic metrics, you can use the batch import feature. DataWorks provides an import template. You can fill in the template with the atomic metrics that you want to import and then upload the file.
Go to the Atomic Metric page, hover over the
icon, and click Import From Excel.For instructions on how to go to the Atomic Metric page, see the steps in the "Create an atomic metric" section.
Select an import type and download the template.
On the Confirm Import Type tab, select an import type for the atomic metrics, download the corresponding template, and then fill in the template.
NoteAfter you select an import type, you can preview the corresponding template and prepare the field content.

Import and confirm the data.
On the Data Import tab, upload and preview the data file. You can choose to preview only the fields whose names already exist in DataWorks, and then delete or modify them as needed.
The selected import type determines the Import Mode and Import Status.
Import Mode: If an object in the imported file has the same name as an existing object in DataWorks, you can choose to skip the object or overwrite the existing object.
Import Status:
Import And Save: Imports and saves the data without creating a new version.
Import And Submit: Imports the data and submits it as a new version.
Batch import supports only .xlsx files. You can import up to 30,000 data records at a time, and the file size cannot exceed 10 MB.

View the import result.
On the OK tab, you can view the import details. In the list, click View More Details next to an atomic metric to open its editing page and perform additional operations. If the import fails, resolve the error based on the provided details and try the import again.
Export atomic metrics
To export many atomic metrics, you can use the batch export feature.
Go to the atomic metric list page.
On the atomic metric page, double-click the
icon above the left-side directory tree to open the atomic metric list. On this page, you can view all created atomic metrics.Select the metrics to export.
NoteYou can skip this step if you use Export All.
You can select metrics in the following two ways:
Search by keyword: Enter a keyword in the search box to find the required metrics.
NoteFuzzy search is supported. After you enter a keyword, all atomic metrics whose names contain the keyword are displayed.
Select directly: Select the required metrics from the list.
Batch export the atomic metrics.
You can export the metrics in one of the following three ways:
Export All: Exports all atomic metrics in the current workspace.
Export Searched Objects: Exports all metrics that match the keyword entered in the search box.
Export Selected Objects: Exports the selected metrics.
View and download the export result.
After you start an atomic metric export task, you are automatically redirected to the Details of Export Status of Atomic Metric page, where you can monitor the export status. After the export is successful, click Download File to download the atomic metrics to your local computer.
Batch delete and submit atomic metrics
If you have multiple obsolete atomic metrics or multiple metrics that have been created but not submitted, you can go to the atomic metric list to delete or submit them in a batch.
Go to the atomic metric list page.
On the atomic metric page, double-click the
icon above the left-side directory tree to open the atomic metric list. On this page, you can view all created atomic metrics.Select the metrics for the batch operation.
NoteFor batch submission, you can select only atomic metrics that are saved but not submitted.
Choose to batch delete or submit the metrics as needed.
Batch Delete: After metrics are deleted, they cannot be referenced by models or derived metrics.
NoteIf an atomic metric is referenced by a model or derived metric, you must remove the reference before you can delete the metric.
Batch Submit: Submits metrics so that they can be referenced by models and derived metrics. This action also generates a new version record. For more information about metric versions, see Manage versions and associated tables.
What to do next
After you create an atomic metric, it can be referenced by derived metrics and models to retrieve the value of a target metric for specific times, dimensions, and business conditions. For more information, see Derived metrics and Publish a model to a compute engine.