Updated on 2024-04-03 GMT+08:00

Creating Derivative Metrics

Derivative metrics are aggregated from the modifiers and dimensions of atomic metrics. Therefore, their modifiers and dimensions are derived from the attributes of atomic metrics as well. When a derivative metric is published, a summary table is automatically generated, which can be viewed in the Automatically Aggregated area on the Summary Table tab page.

Derivative metric = Atomic metric + Dimension + Time filter + General filter

  • Atomic metric specifies the statistical standards, namely, the computing logic.
  • Dimension is the perspective to observe and analyze business data and assist in data aggregation, drilling, slicing, and analysis, and used as a GROUP BY condition in SQL statements.
  • Time filter is a standard definition of a time condition.
  • General filter collects statistics on the business scope and select the records that meet the business rules (similar to the WHERE clause in SQL statements, excluding the time range).

Prerequisites

  • An atomic metric has been created and approved.
  • A dimension and time filter have been created and approved. This prerequisite is required only if the derivative metric will use the statistical dimension or time filter.

Constraints

A maximum of 5,000 derivative metrics can be created in a workspace.

Creating and Publishing a Derivative Metric

  1. On the DataArts Studio console, locate an instance and click Access. On the displayed page, locate a workspace and click DataArts Architecture.
    Figure 1 DataArts Architecture

  2. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Derivative Metrics tab.
  3. Select a subject from the subject tree on the left and click Create.
  4. On the page displayed, set the parameters.
    Figure 2 Creating a derivative metric

    Table 1 Parameters for creating a derivative metric

    Parameter

    Description

    *Data Table

    Select an asset table from the drop-down list box.

    *Subject

    Subject information.

    *Atomic Metric

    Select an atomic metric.

    Dimension

    Select one or more dimensions from the drop-down list box. Only the attributes in the fact table associated with the atomic metrics can be selected.

    Time Filter

    Select the required time filter from the drop-down list and select the associated field. Some time filters are preconfigured in the system. If the available time filters cannot meet the requirements, customize one. See Creating Time Filters for details.

    General Filter

    To set general filters, click Create.

    In the General Filter area shown in Figure 3, set the parameters as follows:

    • Name specifies the name of a general filter.
    • Under Add Condition (and), you can select And condition or Or condition to add a condition. After you specify the condition, select a field from the field drop-down list and set the parameters as prompted. You can add multiple conditions.

      You can click to delete unwanted conditions.

    • Under Add Formula (and), you can select And formula or OR formula to add a formula. Click Edit Formula if needed. In the dialog box displayed, select the required functions and fields and set the expression.

      You can click to delete unwanted formulas.

    Figure 3 Setting a general filter

    Alarm Triggering Condition

    An alarm triggering condition consists of derivative metrics and expressions. An expression consists of alarm parameters and logical operators. When a metric is running, the system calculates the result of the alarm condition expression and determines whether to trigger the alarm based on the result of the expression. If the expression result is true, the alarm will be triggered. Otherwise, no quality alarm will be triggered.

  5. After setting the parameters, click Preview to view the information about the derivative metric and define the name, code, data type, alarm condition, and description for the metric.
    Table 2 Parameters for previewing a derivative metric

    Parameter

    Description

    Metric Name

    It is automatically generated by the system based on parameters such as atomic metrics, statistical dimensions, and time filters. You can also customize it.

    Metric Code

    It is automatically generated by the system based on parameters such as atomic metrics, statistical dimensions, and time filters. You can also customize it.

    Data Type

    It is automatically generated by the system based on the data type of the atomic metric. You can also customize it.

    Alarm Condition

    An alarm condition expression consists of alarm parameters and logical operators. When a metric is running, the system calculates the result of the alarm condition expression and determines whether to trigger the alarm based on the result of the expression. If the expression result is true, the alarm will be triggered. Otherwise, no quality alarm will be triggered.

    Description

    A description of the derivative metric to create. Up to 600 characters are supported.

  6. In the lower part of the page, click Trial Run. In the dialog box displayed, click Trial Run to check whether the derivative metric can run properly.

    If the trial run fails, locate the fault based on the error message, correct the configurations, and click Trial Run to try again.

  7. If the trial run is successful, click Publish.
  8. In the dialog box displayed, select a reviewer and click OK.
  9. (Optional) Create and publish other derivative metrics by repeating 2 to 8.
  10. Wait for the reviewer to approve the application.

    After the application is approved, the derivative metric is created.

    Click the name of a derivative metric to view its details, relationship diagram, publishing history, and review history.

    In the relationship diagram, you can view the lineage diagram of the derivative metric.

    In the release history, you can view the differences between historical versions.

Managing a Derivative Metric

On the Derivative Metrics tab page, you can edit, publish, suspend, or delete derivative metrics.

Figure 4 Managing derivative metrics
  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Derivative Metrics tab.
  2. Manage your derivative metrics as required. Refer to the following table for details.

    Operation

    Helpful Link

    Create

    Creating and Publishing a Derivative Metric

    Edit

    3

    Publish

    4

    View Publish History

    5

    Preview SQL

    6

    Suspend

    7

    View Summary Table

    8

    Delete

    9

    Import

    10

    Export

    11

  3. Edit a derivative metric.
    1. Click Edit to the right of the target derivative metric.
    2. On the page displayed, edit the derivative metric as required.
    3. In the lower part of the page, click Trial Run. In the dialog box displayed, click Trial Run to check whether the derivative metric can run properly.

      If the trial run fails, locate the fault based on the error message, correct the configurations, and click Trial Run to try again.

    4. If the trial run is successful, click Publish.
  4. Publish a derivative metric.
    1. Click Publish to the right of the target derivative metric.
    2. In the Submit for Publication dialog box displayed, select a reviewer from the drop-down list box.
    3. Click OK.
  5. View the publish history.
    1. Select the target derivative metric and choose More > View History.
    2. On the page displayed, you can view the publish history and version comparison information of the metric.
  6. Preview an SQL statement.
    1. Select the target derivative metric and choose More > Preview SQL.
    2. On the page displayed, you can view or copy the SQL statement.
  7. Suspend a derivative metric.

    The prerequisite for suspending a derivative metric is that the derivative metric is not referenced to any compound metrics.

    1. Choose More > Suspend on the right of the target derivative metric.
    2. In the Submit for Suspension dialog box displayed, select a reviewer from the drop-down list box.
    3. Click OK.
  8. View a summary table.

    Currently, only details about automatically generated summary tables can be viewed. Choose More > View Summary Table on the right of the target derivative metric. The Summary Tables page is displayed.

  9. Delete a derivative metric.

    The prerequisite for deleting a derivative metric is that the derivative metric is not referenced to any compound metrics.

    1. Select the target derivative metric and choose More > Delete above the list.
    2. In the dialog box displayed, confirm the information and click Yes.
  10. Import derivative metrics.

    You can import derivative metrics to the system quickly.

    1. Above the summary table list, choose More > Import.
      Figure 5 Importing derivative metrics
    2. Download the derivative metric template, and edit and save it.
    3. Choose whether to update existing data.

      If a code in the template already exists in the system, the data is considered duplicate.

      • No: If the data to be imported already exists in the system, the existing data in the system will not be replaced.
      • Yes: If the data to be imported already exists in the system:
        • If the existing data in the system is in draft state, the data will be replaced and new draft data will be generated.
        • If the existing data in the system is in published state, expanded data will be generated.
    4. Click Select File and select the edited template to import.
    5. Click Upload. When the template is uploaded, the Last Import page is displayed. You can view the imported data.
    6. Click Close.
  11. Exporting derivative metrics.

    You can export derivative metrics to a local file.

    1. In the derivative metric list, select the metric to be exported.
    2. Above the derivative metric list, choose More > Export.
    • You can export all the derivative metrics of a subject by selecting the subject in the subject list on the left.
    • You can export all the derivative metrics of a workspace, as long as there are no more than 5,000 derivative metrics in the workspace.