An atomic metric is an abstraction of the statistical method and specific algorithm for a metric. Dataphin introduces the concept of development automation, where defining a metric also specifies its calculation logic. This improves development efficiency and ensures consistent statistical results. This topic describes how to create an atomic metric.
Prerequisites
You have created a business entity. For more information, see Create and manage business entities.
Procedure
On the Dataphin homepage, click Develop in the top menu bar. The Data Development page appears by default.
In the top menu bar, select a project. If you are in Dev-Prod mode, select an environment.
In the navigation pane on the left, choose Dimensional Modeling > Atomic Metric.
In the atomic metric list, click the
icon and select Create Atomic Metric.In the Create Atomic Metric dialog box, configure the parameters.
Configure the parameters in the Basic Information section.
Parameter
Description
Business Entity
Select a business object or business activity.
Data Domain
The subject area of the business object or business activity is selected by default.
English Name
When you enter an English name, Dataphin matches the input with the roots that are configured in Data Standard in real time. You can select a recommended root as the English name of the business entity. For more information, see Create and manage roots.

The English name must meet the following rules:
Contain only letters, digits, and underscores (_).
Be 64 characters or less.
Chinese Name
The name must meet the following rules:
All characters are accepted.
Be 128 characters or less.
Measurement Unit
Select a measurement unit for the atomic metric. Options include Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, Weight Unit, and Other.
Currency Unit: Fen (CNY), Yuan (CNY), Ten thousand CNY, Million CNY, Ten million CNY, Hundred million CNY, Cent (USD), Dollar (USD), Euro (EUR), Hong Kong dollar (HKD).
Time Unit: Day, Month, Week, Year, Hour, Minute, Second, Quarter, Millisecond.
Ratio Unit: Decimal, Percentile, Permille.
Ranking: Rank (position).
Object Quantifier: Account, Transaction, Item, Unit, Time, Person-day, Store, Lot, Sheet, Pack.
Weight Unit: Ton, Kilogram.
Other: Other.
Data Type
Select a data type for the atomic metric. Options include string, bigint, double, datetime, timestamp, decimal, Text (varchar, char), Numeric (int, smallint, tinyint, float), Date/Time (date), and Other (boolean, binary).
Business Definition
Enter the business definition. This is a natural language description of the metric's definition and processing logic. It helps business users understand how the metric is processed. For example:
Total orders: The total number of valid orders for an outlet, excluding abnormal and incomplete orders. The business definition cannot exceed 1,000 characters.Description
Enter a brief description of the atomic metric. The description cannot exceed 1,000 characters.
Configure the parameters in the Computation Logic section.
Select a data timeliness and configure the calculation logic for the atomic metric. Data timeliness options include Day, Hour, and Minute.
Parameter
Description
Main Source Table
Select a source table. To ensure standard modeling practices, only logical dimension tables or logical fact tables are supported.
Statistical Period Identifier
Specifies the time field for an event or business process. Only accumulating snapshot fact tables (da tables), periodic snapshot fact tables (df tables), and logical dimension tables are supported. Transaction fact tables (di tables) are not supported.
Calculation Logic
Write the calculation logic that defines the atomic metric. For example,
count(distinct order_id), whereorder_idis a field in the source logical table model.NoteClick a field in the list of available fields to add it to the calculation logic editor.
Additive
Indicates whether adding derived metrics at the same statistic granularity has business meaning or follows business rules. In general, metrics that use a distinct count are non-additive.
For example, adding transaction amounts at the user granularity has business meaning. If User A's transaction amount is 100 and User B's transaction amount is 200, their total transaction amount is 300. However, adding the number of buyers at the product granularity has no business meaning. If Brand A phones have 100 buyers and Brand B phones have 50 buyers, the sum of 150 may be inflated. This is because some people may have bought both products, and adding the numbers would count those people twice.
After you configure the parameters, click Save and Submit.
What to do next
If the project is in Dev-Prod mode, you must publish the atomic metric to the production environment. For more information, see Manage publishing tasks.
After you create the atomic metric, you can create derived metrics based on it. For more information, see Create a derived metric.