Managing Derived Metrics


Derived metrics can be defined based on atomic metrics in Metric Management, and operations such as editing and publishing can be performed on derived metrics.

Prerequisites


Before you start, ensure the following:

  • The current account has been assigned a menu group containing Metric Library. If not assigned, contact the application administrator.
  • The current standard metric library already contains the required atomic metrics, or the required atomic metrics are already created.
  • The required dimension tables have been created and published.

Creating a Derived Metric


  1. Select Metric Library in the left navigation bar, which goes to the Atomic Metric tab by default.

  2. Select the Derived Metric tab, select New, and enter the following information on the New Derived Metric page:

    • Metric Type: Select Single-Valued or Multi-Valued, which cannot be changed once created.

      • Single-Valued Metric: A metric with only one fixed value corresponding to it. For example, the amount of power generated by a device on a given day.
      • Multi-Valued Metric: A metric with more than one value corresponding to it. For example, the amount of electricity generated by a device per day.
    • Associated Atomic Metric: In the drop-down box, select the atomic metrics in the built-in Standard Metric library, or select the atomic metric in the created metric library to define the calculation logic of the metric. If the current atomic metric library does not meet your needs, you can also select Create Atomic Metric. For more information, see Creating a Atomic Metric.

    • Statistical Dimension: Select a published dimension table in the drop-down box to define the statistical dimension of the derived metric. If the derived metric does not need to be counted by dimension, select ALL.

    • Period: Select the statistical period of the metric in the drop-down box.

      • When the metric type is multi-valued, historical data within a set period of time will be statistically calculated with the aggregator function according to the selected frequency, and multiple values will be returned. For example, if a device continuously sends data, the statistical period is set to Week, and the metric aggregator function is SUM, if the time range is set to December 1, 2022 - December 14, 2022, the system will use the SUM function to aggregate data from 1 to 7 and the data from 8 to 14 and return 2 values.
      • When the metric type is single-valued, the system will calculate the data within the period using the aggregator function and return a value. For example, if a device continuous sends data, the statistical period is set to Today, and the metric aggregator function is MAX, then when the metric is called, the system will find the maximum data of the day and return it.


      We will use June 23, 2022 as an example to illustrate the period options.

      Period Meaning Example
      This Day Today’s date. June 23, 2022.
      Week To Date From every Monday to today. June 20, 2022 - June 23, 2022.
      Month To Date From the 1st of each month to the current day. June 1, 2022 - June 23, 2022.
      This Month From the 1st of each month to the last day of each month. (For metrics such as planned generation and predicted power, future data needs to be calculated.) June 1, 2022 - June 30, 2022.
      Year To Date From January 1st to the current day of each year. January 1, 2022 - June 23, 2022.
      This Year From January 1st to the last day of each year. (For metrics such as planned generation and predicted power, future data needs to be calculated.) January 1, 2022 - December 31, 2022.
      Beginning Of Life From data generation to the present. If data is entered in the system on June 1, 2019, the period is from June 1, 2019 - June 23, 2022.
      Custom Time Range The data value within the specified time range. Calculates the data value in any time range.
      Latest Latest data values. Only calculates the latest data value at the current moment.


    • Metric Aggregator: The aggregator function is automatically generated by the configuration of the associated atomic metric.

    • Unit: Select the unit of calculation for the derived metric.

    • Data Type: Select the data type for the derived metric.

    • Derived Metric ID: Customize the derived metric ID, or Autogenerate the derived metric ID by default. This cannot be modified after creation.

    • Derived Metric Name: Customize the derived metric name, or Autogenerate the derived metric name by default.

    • Business Owner: Select an account as the business owner under the current OU by entering keywords in the drop-down box. In addition, you can also fill in an account that is not registered under this OU.

    • Development Owner: Select an account as the development owner under the current OU by entering keywords in the drop-down box. In addition, you can also fill in an account that is not registered under this OU.

    • Description: Enter an additional description for the derived metric.

    • Attributes: Select Add Attributes and enter the key-value pair of the attribute to add other attributes to marking or differentiation. For example, the domain to which the metric belongs.

  3. Select Publish to save and publish the derived metric.

    If you do not want to publish it for the moment, select Save to save it as a draft. To publish it later, see Publishing a Derived Metric.


After saving or publishing a derived metric, it can be viewed in the list on the Derived Metric tab.

Editing a Derived Metric


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Select Edit edit_icon at the end of the target derived metric row and save or publish the changes.

Deleting a Derived Metric


To delete a derived metric, ensure that the query mapping group of the derived metric is deleted in advance.


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Select Delete delete_icon after hovering over the ellipsis (…) at the end of the target derived metric row.

Publishing a Derived Metric


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Derived metrics can be published in the following two ways:
    • Select Publish publish_icon at the end of the target derived metric row.
    • Check multiple derived metrics to publish, and then select Publish publish_2_icon at the top of the page to publish derived metrics in batches.

Query mapping groups can only be configured on the Query Mapping tab after the derived metrics are published.

Unpublishing a Derived Metric


To unpublish a derived metric, ensure that the query mapping group configured for the derived metric is deleted in advance. For more information, see Deleting a Query Mapping Group.


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Hover the mouse over the ellipsis (…) at the end of the target derived metric row and select Unpublish unpublish_icon to unpublish the derived metric.

Viewing an Online Version of a Derived Metric


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Hover the mouse over the ellipsis (…) at the end of the target derived metric row for which the status is Updated for Publish, and then select View Online Version view_version_icon to view the derived metric in its most recently modified version.

Reverting a Derived Metric to an Online Version


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Hover the mouse over the ellipsis (…) at the end of the target derived metric row for which the status is Updated for Publish, and then select Revert to Online Version revert_version_icon to republish the previous derived metric.

Exporting/Importing Derived Metrics


Export/import operations are available to share and migrate derived metrics between different OUs.


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Check the derived metrics, then select Export to export a file in JSON format as a template.
  3. Select Import to import the local derived metrics.


After the derived metrics are successfully imported, the following situations will occur:

  • If the imported derived metric ID does not exist in the current metric list, the compound metric will be added to the metric list an automatically published. The status of the derived metric will be changed to Draft.
  • If the imported derived metric ID already exists in the current metric list, and the current metric is in the Draft or Unpublished status, the field value of the imported derived metric will overwrite the field values of the same ID in the list, the metric will be automatically published and the status will change to Draft.
  • If the imported derived metric ID already exists in the current metric list, and the current metric is in the Updated for Publish or Published status, the field values of the imported derived metric will overwrite the field values except for Metric Type of the same ID, and the metric will be automatically published, and the status will be changed to Draft.

Insighting a Derived Metric


To view the value of a derived metric on the Metric Insights page, ensure that the derived metric is published in advance.


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Select Metric Insights insight_icon at the end of the target derived metric row for quickly insight the derived metric value.

Synchronizing Derived Metrics to Common Data Service


You can sync the published derived metrics to EnOS Common Data Service by adding the following attributes to reduct the workload of mapping, debugging, and importing metrics.


Attribute Key Value
Attributes of derived metrics syncToCDA 1
Extra attributes of dimensions businessType The mdm types of the metrics in Common Data Service. For more information, see Business Object Type.

Step 1: Adding Attributes to Derived Metrics


  1. Select Metric Library in the left navigation bar and go to the Derived Metric tab.
  2. Choose one of the following methods to add attributes:
    • Batch Adding:
      1. Select the required derived metrics, click Publish to publish the metrics, and then click Export to export the metrics as a JSON file.
      2. In the attributes field of each line in the file, add the attribute syncToCDA=1 for each metric, for example, "attributes":"[{\"key\": \"syncToCDA\", \"value\": \"1\"}]".
      3. Select Import > JSON File and import the edited file. The existing metrics on the page will be updated if the file is imported successfully.
      4. Select the updated metrics, click Publish to republish the derived metrics.
    • Adding One by One:
      1. Select Edit edit_icon at the end of the target derived metric row to redirect to the Edit Derived Metric page.
      2. Add the syncToCDA=1 attribute in Attributes, where syncToCDA is Key and 1 is Value.
      3. Select Publish to save and publish the derived metric.

Step 2: Adding Extra Attributes to Dimensions


  1. Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
  2. Select Edit edit_icon at the end of the dimension row associated with the derived metric to redirect to the Edit Dimension page.
  3. Add the businessType = <mdm type> attribute in Extra Attributes, where businessType is Key and <mdm type> is the business object type identifier in Common Data Service.
  4. Select Publish to save and publish the dimension.

Results


Once the derived metrics and dimension are published, you can synchronize the derived metrics to Source Metrics or Biz Metrics in CDS. For more information, see Synchronizing Source Metrics from Metric Management and Synchronizing Business Metrics from Metric Management.