Create an atomic metric
An atomic metric abstracts the statistical method and algorithm for a metric. In Dataphin, defining a metric also defines its calculation logic, which ensures consistent results and improves development efficiency.
Prerequisites
You have created a business entity. Create and manage business entities.
Procedure
-
On the Dataphin homepage, click Develop in the top menu bar. The Data Development page appears.
-
In the top menu bar, select a project and, in Dev-Prod mode, an environment.
-
In the left navigation pane, 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
Auto-populated with the subject area of the selected business object or business activity.
English Name
-
Dataphin matches your input against roots configured in Data Standard. You can select a recommended root as the English name. Create and manage roots.

-
Requirements:
-
Contain only letters, digits, and underscores (_).
-
Be 64 characters or less.
-
Chinese Name
Requirements:
-
All characters are accepted.
-
Be 128 characters or less.
Measurement Unit
Select a measurement unit: Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, Weight Unit, or 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: string, bigint, double, datetime, timestamp, decimal, Text (varchar, char), Numeric (int, smallint, tinyint, float), Date/Time (date), and Other (boolean, binary).
Business Definition
A natural language description of the metric's definition and processing logic. Example:
Total orders: The total number of valid orders for an outlet, excluding abnormal and incomplete orders. Maximum 1,000 characters.Description
A brief description of the atomic metric. Maximum 1,000 characters.
-
-
Configure the parameters in the Computation Logic section.
Select a data timeliness (Day, Hour, or Minute) and configure the calculation logic.
Parameter
Description
Main Source Table
Select a source table. Only logical dimension tables and logical fact tables are supported.
Statistical Period Identifier
The time field for an event or business process. Supported table types: accumulating snapshot fact tables (da), periodic snapshot fact tables (df), and logical dimension tables. Transaction fact tables (di) are not supported.
Calculation Logic
Define the calculation logic for the atomic metric. For example,
count(distinct order_id), whereorder_idis a field in the source logical table.NoteClick a field from the available fields list to add it to the editor.
Additive
Whether summing derived metrics at the same granularity is meaningful. Metrics that use a distinct count are typically non-additive.
For example, summing transaction amounts per user is valid (100 + 200 = 300). However, summing buyer counts per product is not, because buyers of multiple products would be counted more than once.
-
After you configure the parameters, click Save and Submit.
-
What to do next
-
If the project is in Dev-Prod mode, publish the atomic metric to the production environment. Manage publishing tasks.
-
Create derived metrics based on the atomic metric. Create a derived metric.