All Products
Search
Document Center

Dataphin:Create an atomic metric

Last Updated:May 28, 2025

An atomic metric is an abstraction of the statistical caliber and specific algorithm of a metric. Dataphin innovatively introduces the concept of development automation, where metric definition also clarifies the statistical caliber design (calculation logic), improving development efficiency and ensuring consistency of 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

  1. On the Dataphin homepage, click Develop in the top navigation bar. The Data Development page appears by default.

  2. In the top navigation bar, select a project (In Dev-Prod mode, you need to select an environment).

  3. In the left-side navigation pane, choose Dimensional Modeling > Atomic Metric.

  4. In the atomic metric list, click the image icon and select Create Atomic Metric.

  5. In the Create Atomic Metric dialog box, configure the parameters.

    1. Configure the parameters in the Basic Information section.

      Parameter

      Description

      Business Entity

      Select a business object or business activity.

      Data Domain

      The subject area to which the business object or business activity belongs is selected by default.

      English Name

      • When you enter an English name, Dataphin matches the input data with the roots configured in the 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 requirements:

        • It can contain only letters, digits, or underscores (_).

        • It cannot exceed 64 characters.

      Chinese Name

      The name must meet the following requirements:

      • It can contain any characters.

      • It cannot exceed 128 characters.

      Measurement Unit

      Select a measurement unit for the atomic metric. The options include Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, Weight Unit, and Other.

      • Currency Unit: Cent (CNY), Yuan (CNY), 10,000 Yuan (CNY), Million Yuan (CNY), 10 Million Yuan (CNY), 100 Million Yuan (CNY), Cent (USD), Dollar (USD), Euro (EUR), Dollar (HKD).

      • Time Unit: Day, Month, Week, Year, Hour, Minute, Second, Quarter, Millisecond.

      • Ratio Unit: Decimal, Percentile, Thousands separator.

      • Ranking: Ranking (Position).

      • Object Quantifier: Household, Transaction, Item, Piece, Time, Person-day, Company, Hand, Sheet, Package.

      • Weight Unit: Ton, Kilogram.

      • Other: Other.

      Data Type

      Select a data type for the atomic metric. The options include string, bigint, double, datetime, timestamp, decimal, Text (varchar, Char), Numeric (int, smallint, tinyint, float), Date Time (date), Other (boolean, binary).

      Metric Caliber

      Enter the metric caliber, which is a natural language description of the definition and processing logic of the metric to help business personnel understand the metric processing logic. For example: Total orders: the total number of valid orders in a store, excluding abnormal and incomplete orders. The metric caliber cannot exceed 1,000 characters.

      Description

      Enter a brief description of the atomic metric. The description cannot exceed 1,000 characters.

    2. Configure the parameters in the Computation Logic section.

      You can select data timeliness and configure calculation logic for the atomic metric based on business requirements. Data timeliness options include Day, Hour, and Minute.

      Parameter

      Description

      Main Source Table

      Select a source table. To ensure modeling standards, only logical dimension tables or logical fact tables are supported as source tables.

      Statistical Period Identifier

      The statistical period identifier can specify a time field for an event (business process). Only logical flow fact tables (df tables) and logical dimension tables are supported, not logical event fact tables (di tables) (which can also be understood as defaulting to the ds partition field).

      Calculation Logic

      Write the calculation logic that defines the atomic metric. For example, count(distinct order_id), where order_id is a field in the source logical table model.

      Note

      Click a field in the applicable list to add it to the calculation logic editor.

      Additive

      Additive indicates whether adding metrics (derived metrics) at the same statistical granularity has business meaning or complies with business rules. Generally, metrics that use distinct count are non-additive.

      For example, adding transaction amounts at the user granularity has business meaning: if Zhang San's transaction amount is 100 and Li Si's transaction amount is 200, then the two people's 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 might be inflated because some people may have bought both products, and adding them would count these people twice.

    3. After completing the configuration, click Save And Submit to submit the atomic metric.

What to do next

  • If the project mode is Dev-Prod, you need to publish the atomic metric to the production environment. For more information, see Manage publishing tasks.

  • After creating the atomic metric, you can create derived metrics based on it as needed. For more information, see Create a derived metric.