All Products
Search
Document Center

Dataphin:Create a composite metric

Last Updated:May 28, 2025

A composite metric is created based on submitted atomic metrics with defined calculation logic. For example, if you have a submitted atomic metric for payment amount and another for number of payers, you can create a composite metric to calculate the average payment amount per person. This topic describes how to create a composite metric.

Procedure

  1. On the Dataphin homepage, click Developer 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 Standardized Modeling > Atomic Metric.

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

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

    1. Configure the parameters in the Basic Information section.

      Parameter

      Description

      English Name

      Naming convention:

      • The name can contain letters, digits, or underscores (_).

      • The name can be up to 64 characters in length.

      Chinese Name

      Naming convention:

      • The name can contain any characters.

      • The name can be up to 128 characters in length.

      Measurement Unit

      Select a measurement unit for the composite metric. Options include Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, and Other.

      Options include Currency Unit, Time Unit, Ratio Unit, Ranking, Object Quantifier, 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.

      • 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 composite metric. Options include string, bigint, double, datetime, timestamp, decimal, Text, Numeric, Datetime Variable, Other.

      Data Domain

      Select a subject area for the composite metric.

      Description

      Enter a brief description of the composite metric.

    2. Configure the parameters in the Computation Logic section.

      • Metric Definition: Enter the metric definition, which describes the definition and calculation logic of the metric in natural language to help business users understand the calculation logic. For example: Average order value = Total sales / Total number of orders. During this process, you can add atomic metrics to the calculation expression by entering @ or clicking an atomic metric in the Reference Field List. The metric definition cannot exceed 1000 characters.

      • Computation Logic: You need to decide whether to use cumulative calculation based on data from different statistical periods. For example, for the payment amount in the last 7 days, you need to decide whether to calculate it by accumulating the payment amount for the last day.

        You also need to define the calculation expression based on submitted atomic metrics. For example, crt_amt/usr_cnt, where crt_amt is the submitted atomic metric for order amount and usr_cnt is the submitted atomic metric for user count, to calculate the average order amount per user.

      • Reference Field List: Click a metric name in the Reference Field List to add the metric to the metric definition and calculation logic. You can search for metrics by entering keywords.

  6. After you complete the configuration, click Save And Submit.

What to do next

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