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

Creating Compound Metrics

A compound metric is generated by adding one or more derivative metrics. The dimensions and modifiers of a compound metric are the same as those of the derivative metrics. New dimensions and modifiers cannot be generated outside the scope of derivative metrics, dimensions, and modifiers.

Constraints

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

Prerequisites

A derivative metric has been created and approved. For details, see Creating Derivative Metrics.

Creating a Compound 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 Compound 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 compound metric

    Table 1 Parameters for creating a compound metric

    Parameter

    Description

    *Metric Name

    Compound metric names must start with letters. Only letters, numbers, and underscores (_) are allowed.

    *Metric Code

    Metric code names must start with letters. Only letters, numbers, and underscores (_) are allowed.

    *Subject

    Subject information. Select a subject.

    *Statistical Dimension

    The available options are those configured on the Derivative Metrics page.

    *Data Type

    Select a data type for the compound metric.

    *Compound Metric Type

    The following options are available:

    • Expression
    • Growth compared with the same period last year
    • Growth compared with the last period

    Description

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

    Expression

    *Expression

    Select the required derivative metrics or compound metrics and set the expression as required.

    Growth compared with the same period last year

    *Period Type

    Select Year, Month, or Week.

    *Derivative Metric

    Select derivative metrics (only derivative metrics with time filters are displayed). The system automatically calculates the growth compared with the same period last year based on the time filter.

    Growth compared with the last period

    *Derivative Metric

    Select derivative metrics (only derivative metrics with time filters are displayed). The system automatically calculates the growth compared with the last period based on the time filter.

  5. In the lower part of the page, click Trial Run. In the dialog box displayed, click Trial Run to check whether the compound 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.

  6. If the trial run is successful, click Publish.
  7. In the dialog box displayed, select a reviewer and click OK.
  8. Wait for the reviewer to approve the application.

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

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

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

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

Editing a Compound Metric

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
    Figure 3 Compound metrics
  2. In the compound metric list, select the target metric and click Edit on the right.
  3. On the page displayed, set the parameters as prompted. For details, see Table 1.
  4. In the lower part of the page, click Trial Run. In the dialog box displayed, click Trial Run to check whether the compound 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.

  5. If the trial run is successful, click Publish.
  6. In the dialog box displayed, select a reviewer and click OK.

Publishing a Compound Metric

After creating or editing a compound metric, it takes effect only after it is published. Compound metrics in publishing review, published, or suspension review state cannot be published.

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
  2. In the compound metric list, select the target compound metric and click Publish.
  3. In the dialog box displayed, click OK.

Viewing the Publish History

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
  2. Select the target compound metric in the list and choose More > View History.
  3. On the page displayed, you can view the publish history and version comparison information of the metric.

Previewing an SQL Statement

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
  2. Locate the target compound metric and choose More > Preview SQL.
  3. In the dialog box displayed, you can view or copy the SQL statement.

Suspending a Compound Metric

You can bring a published compound metric offline if it is no longer used.

The prerequisite for suspending a compound metric is that the metric is not referenced to any summary table.

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
  2. In the compound metric list, select the target compound metrics and click Suspend above the list.
  3. In the dialog box displayed, click OK.

Deleting a Compound Metric

The prerequisite for deleting a compound metric is that the metric is not referenced to any summary table.

  1. On the DataArts Architecture page, choose Metrics > Technical Metrics in the left navigation pane. On the displayed page, click the Compound Metrics tab.
  2. Select the target compound metric and choose More > Delete above the list.
  3. In the dialog box displayed, confirm the information and click Yes.

Importing Compound Metrics

You can import compound metrics to the system quickly.

  1. Above the compound metric list, choose More > Import.
    Figure 4 Importing Compound Metrics
  2. Download the compound 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.

Exporting Compound Metrics

You can export compound metrics to a local file.

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