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¶
Select Metric Library in the left navigation bar, which goes to the Atomic Metric tab by default.
Select the Derived Metric tab, select New, and enter the following information on the New Derived Metric page:
Metric Type: Select
Single-Valued
orMulti-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 isSUM
, if the time range is set to December 1, 2022 - December 14, 2022, the system will use theSUM
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 isMAX
, 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.
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¶
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Select Edit 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.
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Select Delete after hovering over the ellipsis (…) at the end of the target derived metric row.
Publishing a Derived Metric¶
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Derived metrics can be published in the following two ways:
Select Publish at the end of the target derived metric row.
Check multiple derived metrics to publish, and then select Publish 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.
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Hover the mouse over the ellipsis (…) at the end of the target derived metric row and select Unpublish to unpublish the derived metric.
Viewing an Online Version of a Derived Metric¶
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
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 to view the derived metric in its most recently modified version.
Reverting a Derived Metric to an Online Version¶
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
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 to republish the previous derived metric.
Exporting/Importing Derived Metrics¶
Export/import operations are available to share and migrate derived metrics between different OUs.
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Check the derived metrics, then select Export to export a file in JSON format as a template.
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
orUnpublished
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 toDraft
.If the imported derived metric ID already exists in the current metric list, and the current metric is in the
Updated for Publish
orPublished
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 toDraft
.
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.
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Select Metric Insights 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¶
Select Metric Library in the left navigation bar and go to the Derived Metric tab.
Choose one of the following methods to add attributes:
Batch Adding:
Select the required derived metrics, click Publish to publish the metrics, and then click Export to export the metrics as a JSON file.
In the
attributes
field of each line in the file, add the attributesyncToCDA=1
for each metric, for example,"attributes":"[{\"key\": \"syncToCDA\", \"value\": \"1\"}]"
.Select Import > JSON File and import the edited file. The existing metrics on the page will be updated if the file is imported successfully.
Select the updated metrics, click Publish to republish the derived metrics.
Adding One by One:
Select Edit at the end of the target derived metric row to redirect to the Edit Derived Metric page.
Add the
syncToCDA=1
attribute in Attributes, wheresyncToCDA
is Key and1
is Value.Select Publish to save and publish the derived metric.
Step 2: Adding Extra Attributes to Dimensions¶
Select Dimensions in the left navigation bar, which goes to the Dimension Definition tab by default.
Select Edit at the end of the dimension row associated with the derived metric to redirect to the Edit Dimension page.
Add the
businessType = <mdm type>
attribute in Extra Attributes, wherebusinessType
is Key and<mdm type>
is the business object type identifier in Common Data Service.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.