Unit 4: Developing and Querying Metrics


This unit creates the derived metrics of Solar_Site-Level_Cumulative_Generation, Site_Day-Level_Ambient_Temperature, and Site-Level_Cumulative_Horizontal_Radiance, and configures the query mapping groups based on the metric requirements and the configured dimension tables and fact tables


Step 1: Creating Derived Metrics

Creating the Cumulative Generation Metric of the Solar Site


  1. Select Metric Library from the left navigation pane and select Derived Metric tab.

  2. Select New, and enter the following information in the New Derived Metric Page:

    • Metric Type: Select Single Valued

    • Associated Atomic Metric

      • Metric Library: Select Standard Metric

      • Atomic Metric: Select Solar Generation

    • Statistical Dimension: Select dim_solarplant

    • Period: Select Beginning of Life

    • Metric Aggregator: Automatic generation of SUM based on the correlated atomic metric

    • Unit: Automatic generation of kWh based on the correlated atomic metric

    • Data Type: Select DECIMAL

    • Derived Metric ID: Select Autogenerate and generate the ID of sumactualSolarproduction_dim_solarplant_bol

    • Derived Metric Name: Enter Solar_Site-Level_Cumulative_Generation


    ../_images/derived_metric.png


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

Creating the Day-Level Ambient Temperature Metric of the Site


  1. In the Derived Metric tab, select New, and enter the following information in the New Derived Metric Page:

    • Metric Type: Select Single Valued

    • Associated Atomic Metric

      • Metric Library: Select Standard Metric

      • Atomic Metric: Select Average Ambient Temperature

    • Statistical Dimension: Select dim_sensor

    • Period: Select This Day

    • Metric Aggregator: Automatic generation of AVG based on the correlated atomic metric

    • Unit: Automatic generation of °C based on the correlated atomic metric

    • Data Type: Select STRING

    • Derived Metric ID: Select Autogenerate and generate the ID of avgambienttemp_dim_sensor_td

    • Derived Metric Name: Enter Site_Day-Level_Ambient_Temperature

  2. Select Publish to save and publish this derived metric.

Creating the Site-Level Cumulative Horizontal Radiance Metric


  1. In the Derived Metric tab, select New, and enter the following information in the New Derived Metric Page:

    • Metric Type: Select Single Valued

    • Associated Atomic Metric

      • Metric Library: Select Standard Metric

      • Atomic Metric: Select Cumulative Horizontal Radiance

    • Statistical Dimension: Select dim_sensor

    • Period: Select Beginning of Life

    • Metric Aggregator: Automatic generation of SUM based on the correlated atomic metric

    • Unit: Automatic generation of Wh/m² based on the correlated atomic metric

    • Data Type: Select STRING

    • Derived Metric ID: Select Autogenerate and generate the ID of sumirradianceghi_dim_sensor_bol

    • Derived Metric Name: Enter Site-Level_Cumulative_Horizontal_Radiance

  2. Select Publish to save and publish this derived metric.

Step 2: Configuring Query Mappings

Configuring the Query Mapping of the Cumulative Generation Metric of the Solar Site


  1. Select the Query Mapping tab, select New, go to the New Mapping Configuration Group page, and enter the following information:

    • Group Basic Configuration

      • Basic Information

        • Group ID: Enter solar_plant_power

        • Mapping Configuration Group Name: Enter Cumulated_Generation_of_the_Solar_Site

      • Data Source Configuration

        • Calculation Method: Select Fact Table Pass-Through

        • Fact Tables: Select fact_solarpower

        • Time Field: Select date_time

        • Dimension: Select dim_solarplant


      ../_images/metric_group.png


    • Metric Configuration:

      • Metric ID: Select sumactualSolarproduction_dim_solarplant_bol

      • Fact Table Field: Select total_yield

  2. Select Next to preview the configuration.

  3. Select Publish to save and publish the query mapping group.

Configuring Query Mappings of Day-Level Ambient Temperature of Site and Site-Level Cumulative Horizontal Radiance Metrics


  1. Select the Query Mapping tab, select New, go to the New Mapping Configuration Group page, and enter the following information:

    • Group Basic Configuration

      • Basic Information

        • Group ID: Enter plant_sensor

        • Mapping Configuration Group Name: Enter Cumulative_Radiance_of_Ambient_Temperature_of_the_Site

      • Data Source Configuration

        • Calculation Method: Select Fact Table Pass-Through

        • Fact Tables: Select fact_sensor

        • Time Field: Select date_time

        • Dimension: Select dim_solarplant

    • Metric Configuration

      • Average Temperature Metric

        • Metric ID: Select avgambienttemp_dim_sensor_td

        • Fact Table Field: Select ambient_temperature

      • Cumulated Radiance Metric

        • Metric ID: Select sumirradianceghi_dim_sensor_bol

        • Fact Table Field: Select irradiation

  2. Select Next to preview the configuration.

  3. Select Publish to save and publish the query mapping group.

Step 3: Querying Metrics


After publishing the query mapping groups, you can query the published metrics in the following two ways.

Querying Metrics in Metric Insights


  1. Select Metric Insights in the left navigation pane and select the following information in the page:

    • Metric Type: Select Single-Valued

    • Statistical Dimension: Select dim_solarplant or dim_sensor

    • Statistical Objects: Select one or more device IDs of solar_plant or weather_sensor

    • Metrics: Select Solar_Site-Level_Cumulative_Generation, Site_Day-Level_Ambient_Temperature, or Site-Level_Cumulative_Horizontal_Radiance

  2. Click Query to insight the metrics.

Querying Metrics by Open API


Query the data of the metrics that have been published and configured with query mapping groups by the Open API of Metric Management:

https://{apigw-address}/metric-mgmt/v1.0/metrics/data/normal