Create an atomic metric

更新时间: 2026-06-02 21:47:48

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

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

  2. In the top menu bar, select a project and, in Dev-Prod mode, an environment.

  3. In the left 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

      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.

        image.png

      • 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.

    2. 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), where order_id is a field in the source logical table.

      Note

      Click 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.

    3. After you configure the parameters, click Save and Submit.

What to do next

上一篇: Create atomic metrics 下一篇: Create a composite metric
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈