Derived metrics define the scope of atomic metric statistics. This topic describes how to create a derived metric.
Prerequisites
You have created business entities and business filters. For more information, see Create and manage business entities and Create a business filter.
Procedure
On the Dataphin homepage, click Develop > Data Development in the top navigation bar.
In the top menu bar, select a project (and an environment if you are using the Dev-Prod mode).
In the left navigation bar, choose Modeling > Metrics. In the metric list on the right, click the
icon.In the Create Derived Metric wizard, configure the following parameters in the Define Derived Metric step.
Parameter
Description
Metric Definition
Enter the metric definition, which describes the definition and processing logic of the metric in natural language to help business users understand the metric processing logic. For example:
Number of male customers who completed transactions in each outlet in the last day: Count the number of male customers who successfully completed at least one transaction order in each outlet in the last day, excluding uncompleted and canceled orders, and removing duplicates for repeated transaction records of the same customer in the same outlet. The metric definition cannot exceed 1,000 characters.Metric Definition
Statistical Period
Select a statistical period for the derived metric. The statistical period defines the time span of the source data for the metric. For example, if you select the last 7 days, the system will calculate the behavioral data from the last 7 days. You can select up to 3 statistical periods.
Atomic Metric
Select an atomic metric for the derived metric. The system only supports selecting atomic metrics with the same data timeliness.
Business Condition
Select a business filter for the derived metric. The system only supports selecting business filters with the same data timeliness as the selected atomic metric.
Statistical Granularity Settings
Statistical Granularity
The system automatically fills in the timeliness of the statistical granularity based on the selected statistical period. You only need to select the object granularity. You can add up to 3 object granularities.
Click Next.
In the Pre-generate Derived Metric step, confirm the generated derived metric and click Next.
Parameter
Description
Metric English Name
The system automatically generates the metric English name in the format of <atomic metric English name>_<statistical period abbreviation>_<business filter English name>. You can customize it. The ID must meet the following requirements:
Only English letters, digits, and underscores (_) are allowed. The name must start with a letter and cannot exceed 100 characters.
The metric English name must be unique in the aggregate table.
AnalyticDB PostgreSQL supports a maximum length of 50 characters.
Metric Name
The system automatically generates the name. You can customize it.
In the Complete Metric Information step, configure the parameters.
Parameter
Description
Operation Owner
Select an operation owner for the current derived metric.
Click Set Operation Owner to batch modify the operation owner for all current derived metrics.
Business Owner
Select a business owner for the current derived metric.
Click Set Business Owner to batch modify the business owner for all current derived metrics.
Scheduling Configuration
Click
to configure the scheduling configuration for the derived metric. The scheduling configurations and parameter descriptions supported by derived metrics are as follows:Schedule Type: Derived metrics only support Normal Scheduling.
Effective Date: Derived metrics do not support setting an effective date.
Recurrence: The system automatically sets the corresponding value based on the statistical period of the derived metric. This includes year, month, week, day, hour, and minute. Year, month, and week are compatible with the system's automatic scheduling cycle and cannot be selected. You can implement year, month, and week scheduling through conditional scheduling.
NoteThe statistical period of a derived metric is a financial statistical period. You cannot modify the scheduling cycle of a derived metric by modifying the financial statistical period.
Scheduling Plan: Click Preview to view the scheduling plan. According to the configured scheduling cycle and conditional scheduling, the scheduling plan displays all scheduling instances and their scheduling types for each day of a month. You can choose to preview the date type by Data Timestamp or Runtime Date (Scheduling Date).
If there are multiple scheduling type statuses for all instances in a day, all included scheduling type statuses are displayed by color, along with the name of each scheduling type status and the corresponding number of instances. For example, the figure below shows that on the 4th day of a month, the current scheduling task has 44 normal scheduling instances, 2 paused instances, and 12 dry-run instances.

Hover your mouse over a scheduling type module on a specific day to view the detailed scheduling instance list for the current scheduling task on that day, including scheduling type, scheduling condition, and condition name.
Conditional Scheduling: After enabling conditional scheduling, you need to select a Configuration Method, which can be either Custom Settings or Scheduling Template.
ImportantFor multiple groups of scheduling conditions (maximum 10), the system will evaluate the conditions from top to bottom. When a condition is met, the corresponding scheduling action is executed, and all subsequent condition evaluations are terminated. If no condition is met, the default scheduling configuration is executed.
Conditional scheduling is only effective when the scheduling type is Normal Scheduling.
Both scheduling conditions and trigger times are calculated using the configured scheduling time zone.
Custom Settings
Click + Add Scheduling Condition.
In the Edit Conditional Scheduling dialog box, configure the conditional scheduling information.
Condition Name: Supports any character with a length within 32 characters.
Effective Status: Enabled by default. When disabled, this conditional scheduling will be ignored during scheduling.
Meet the Following Conditions: The judgment rule for the condition. When the condition is evaluated as true, scheduling is performed according to the Execute Scheduling configuration. For configuration instructions, see Conditional scheduling rule description.
Execute Scheduling: Supports custom and follow scheduling attributes:
Custom: When the condition is evaluated as true, scheduling runs according to the configured Scheduling Type.
Follow Scheduling Attributes: Consistent with the scheduling strategy in the scheduling attributes, equivalent to the scheduling settings when conditional scheduling is disabled.
Scheduling Type: For configuration instructions, see Scheduling Type above.
Click OK.
After completing the conditional scheduling settings, click Preview Scheduling Plan to view the dates in the calendar where the conditions are met.
ImportantAfter modifying the conditional scheduling settings, submitting, and publishing to the production environment, the changes will take effect in real time for instances that are in the Not Running status at the time of publishing. The changes will not take effect for instances that have already entered the Waiting for Runtime status.
When using cross-node parameter judgment types in conditional scheduling, you must provide possible parameter values for preview.
Scheduling Template
After selecting Scheduling Template, you can select any Conditional Scheduling Template configured in Planning > Common Business Logic > Offline Scheduling Templates. If there is no template that meets your requirements, you can click Create Scheduling Template to create a new one. After selecting a template, you cannot add scheduling conditions. You can click the View Details icon after each scheduling condition to view the conditional scheduling details.
NoteIf the current task's scheduling cycle is daily, weekly, or monthly, then the trigger time parameter in the referenced conditional scheduling template will take effect. If the current task's scheduling cycle is hourly or by minute, then the trigger time parameter will not take effect.
Upstream Dependency: The system generates upstream dependencies based on the derived metric. You cannot modify or delete these dependencies. When modifying the dependency cycle, if the time unit of the modified dependency cycle is smaller than the time unit of the derived metric's data timeliness, the system will automatically add a self-dependency for this node.
Description
Enter a brief description of the derived metric, within 1,000 characters.
Click Submit, enter a Submission Note, and then click OK And Submit to complete the submission of the derived metric.
What to do next
If the project mode is Dev-Prod, you need to publish the derived metric to the production environment. For more information, see Manage publishing tasks.