Atomic metrics abstract metric statistical calibers and specific algorithms. Dataphin introduces development automation, streamlining metric definition by clarifying statistical calibers, which enhances development efficiency and ensures consistent statistical outcomes. This topic outlines the process for creating atomic metrics.
Procedure
Navigate to the Dataphin home page and single click the top menu bar Development. You will be directed to the data Development page by default.
Use the operation guide in the figure below to access the New Atomic Metric dialog box.
In the New Atomic Metric dialog box, set the parameters.
Fill in the parameters in the Basic Information section.
Parameter
Description
Business Entity
Choose a business object or activity.
Data Domain
The subject area for the business object or activity is preselected.
English Name
Input the English name and Dataphin will suggest roots from the data standard in real-time. Select the recommended root as the English name of the business entity. For more details, see New and manage roots.
The English name should adhere to the following conventions:
Supports only letters, numbers, or underscores (_).
Must not exceed 64 characters.
Chinese Name
The naming conventions are as follows:
Supports any character.
Must not exceed 128 characters.
Measurement Unit
Choose the measurement unit for the atomic metric, such as Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, Weight Unit, and Others.
Currency Unit: cent (RMB), yuan (RMB), ten thousand yuan (RMB), million yuan (RMB), ten million yuan (RMB), billion yuan (RMB), 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, thousandth.
Ranking: ranking.
Object Quantifier: household, transaction, piece, item, time, person-day, family, hand, sheet, package.
Weight Unit: ton, kilogram.
Others: other.
Data Type
Select the data type for the atomic metric, including string, bigint, double, datetime, timestamp, decimal, Text (varchar, Char), Number (int, smallint, tinyint, float), Datetime (date), and Others (boolean, binary).
Description
Provide a concise description of the atomic metric, limited to 1000 characters.
Enter the parameters in the Computation Logic section.
Select the data timeliness and define the calculation logic for the atomic metric according to business needs. Data timeliness options include day, hour, and minute.
Parameter
Description
Main Source Table
Choose the source table. For modeling standards, only logical dimension tables or logical fact tables are accepted as source tables.
Statistical Period Identifier
The statistical period identifier marks the time field of an event (business process). It supports logical process fact tables (df tables) and logical dimension tables, but not logical event fact tables (di tables), which can be considered as the default ds partition field.
Calculation Logic
Draft the calculation logic that defines the atomic metric. For instance,
count(distinct order_id)
, whereorder_id
is a field in the source logical table model.NoteSingle click fields in the available list to add them to the calculation logic editor.
Is Cumulative
For example, the cumulative transaction amount at the user level is meaningful. If Zhang San's transaction amount is 100, and Li Si's is 200, the total is 300. However, the cumulative number of buyers at the product level is not business-relevant. If brand A has 100 buyers and brand B has 50, the total of 150 may be inflated as some individuals may have purchased both, leading to double-counting.
Once configured, single click Save And Submit to finalize the atomic metric.
What to do next
If the project operates in a Dev-Prod mode, publish the atomic metric to the production environment. For detailed instructions, see Manage publishing tasks.
Following the creation of the atomic metric, you can proceed to develop the necessary derived metrics based on it. For step-by-step guidance, refer to Create derived metrics.