Create a composite metric
A composite metric combines submitted atomic metrics with defined calculation logic. For example, if you have submitted atomic metrics for payment amount and number of payers, you can create a composite metric to calculate the average payment amount per person.
Procedure
-
On the Dataphin homepage, click Developer in the top navigation bar. The Data Development page appears by default.
-
In the top navigation bar, select a project (In Dev-Prod mode, you need to select an environment).
-
In the left-side navigation pane, choose Standardized Modeling > Atomic Metric.
-
In the atomic metric list, click the
icon and select Create Composite Metric. -
In the Create Composite Metric dialog box, configure the parameters.
-
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
The measurement unit of 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
The data type of the composite metric. Options include string, bigint, double, datetime, timestamp, decimal, Text, Numeric, Datetime Variable, Other.
Data Domain
The subject area of the composite metric.
Description
A brief description of the composite metric.
-
-
Configure the parameters in the Computation Logic section.
-
Metric Definition: A natural-language description of the metric and its calculation logic, which helps business users understand how the metric is calculated. For example:
Average order value = Total sales / Total number of orders. You can add atomic metrics to the expression by entering@or clicking an atomic metric in the Reference Field List. The metric definition cannot exceed 1000 characters. -
Computation Logic: Specify whether to use cumulative calculation based on data from different statistical periods. For example, for the payment amount in the last 7 days, decide whether to calculate it by accumulating the payment amount for the last day.
Define the calculation expression based on submitted atomic metrics. For example,
crt_amt/usr_cnt, wherecrt_amtis the submitted atomic metric for order amount andusr_cntis the submitted atomic metric for user count, to calculate the average order amount per user. -
Reference Field List: Click a metric name to add it to the metric definition and calculation logic. You can search for metrics by entering keywords.
-
-
-
After you complete the configuration, click Save And Submit.
What to do next
If the project is in Dev-Prod mode, publish the composite metric to the production environment. For more information, see Manage publishing tasks.