Define Your Own Metrics

Define custom metrics to monitor indicators that are meaningful to you and that help you understand the status of your factories and machines.

You must create a new metric before adding it to the Map view toolbar or the factory view toolbar.

Create a new metric:

  1. Click Menu Menu icon and then click Design Center.
  2. Select Organization from the Design Center menu.
  3. Click Metrics Metrics icon.
  4. Click Create Metric Add icon.
  5. Enter a Name to identify the new metric.
  6. Select the Entity Type to which the metric applies.
    The Entity Type is usually the machine type. You have the following options:
    • All Factories: Select if your metric applies to all factories. For example, a metric that calculates the percentage of machines that are down per factory.
    • All Machines: Select if your metric applies to all machines. For example, a metric that calculates the average production quantity per machine.
    • Production Plans: Select if your metric applies to production plans. For example, a metric that calculates the hourly average of actual quantities produced for a particular routing task.
    • Maintenance Schedules: Select if your metric applies to maintenance schedules. For example, a metric that queries the maintenance start times and end times.
    • Machines: Lists the various machine types available. Select the machine type if you are creating a metric that applies to a machine type. For example, a metric that calculates the average dispensation rate for a dispenser machine.
    • Work Orders: Select to use work order data attributes in your metric formula. For example, a metric that calculates the reject quantity produced for a product, as a percentage of the total quantity produced.
  7. Under Calculation Scheduling, select an appropriate option.
    • On Demand: On-demand metrics get calculated when they appear on a page, such as the Map page. On-demand metrics use less computational resources. You cannot use an on-demand metric for anomalies, predictions, and historical analysis.

    • On Schedule: Scheduled metrics are refreshed at the intervals you specify. You can choose between weekly, daily, hourly, and live metrics. Scheduled metrics can be used in anomalies, predictions, and historical analysis.

      Metrics can be calculated per entity (machine), or can be calculated globally for an entity type (machine type).

  8. If creating a scheduled metric, specify a calculation Schedule:
    • Live calculates the metric every two minutes.

      Use this option sparingly, as it may require a lot of computational and storage resources depending on your number of machines. The Live option may be used in special circumstances: For example, when the metric is to be used for anomaly detection purposes.

    • Hourly aggregates the metric for every hour.

    • Daily aggregates the metric for every day.

    • Weekly aggregates the metric for every week.

  9. (Optional) For scheduled metrics, click Edit Edit icon to change the Data Window to use.
    By default, the Data Window is the same as the calculation schedule. For example, if you have set the metric schedule to Hourly, the data from the previous hour is used to calculate the metric.
    You can also use flexible data windows for your scheduled metric calculations. The data window can be different from the calculation schedule. For example, you may wish to compute the total output for the past twenty-four hours, and calculate this metric hourly.
    In addition to sliding data windows, you can also use dynamic custom data windows. For example, you may wish to do an hourly calculation of the cumulative output for the day, starting 9 a.m. in the morning.
    1. Select a Configuration value:
      • Default: Uses the default data window as per the selected schedule. For example, if you have set the metric schedule to Hourly, the data from the previous hour is used to calculate the metric.
      • Data Window Start Time: Lets you pick from a number of fixed options. For example, you may use data from the last one week, and calculate the metric hourly.

        When choosing larger data windows, ensure that the data life span settings for your custom metrics are large enough in the application settings, so that there is data available for the selected window.

      • Custom Data Window Start Time: Lets you choose a fixed start time for the data window. For example, you may wish to do an hourly calculation of the cumulative output for the day, starting 9 a.m. in the morning.

        This option is only available when selecting the Live or Hourly schedule.

    2. Select the Data Window value corresponding to the selected configuration:
      • If you selected Default, the Data Window is automatically selected to match the metric calculation schedule.
      • If you selected Data Window Start Time, specify the Offset to use. For example, choose One Week Ago, to use the data from the past one week.
      • If you selected Custom Data Window Start Time, then specify the fixed start Time for the data window in the UTC (Coordinated Universal Time ) time zone.
  10. Using the Formula editor, define an expression to calculate the new metric.
    You can build your operation using the elements in the Formula editor, or click Advanced to directly edit the SQL-like expression.
    The default formula uses the Count function on the properties you choose. So, for example, you may want a count of the number of factories with pending work orders greater than 10.
    To select a different function or aggregation, click the function name (COUNT), select the function name, and choose from the properties available for the selected function. The following additional functions are available:
    • SUM

    • AVERAGE

    • MIN (Minimum)

    • MAX (Maximum)

    Build your expression using the toolbar in the Formula editor, or by typing in the expression.

    This image shows you how to use the formula editor:

    This image is described in the surrounding text.
    Your expression can contain the following elements:
    • Parenthesis: Use parenthesis to group operations and indicate precedence.
    • Symbols: You can use arithmetic, relational, and logic operators. When you click the Symbol button, the add operator appears in our formula. If you want to select another operator, click the add icon and select an operator from the list.
    • Numbers, text, and boolean values.
    • Properties: A list of predefined indicators that you can use to build your own metrics. This list is based on the business entity that you selected.
    The description for the metric is automatically created based on the properties and operators that you select.
  11. (Optional) Click Validate Formula to validate your expression.
  12. (Optional) Under Testing, click Run Test to view sample metric results on live machine data.

    Note:

    You must successfully validate the formula before Run Test is enabled.
    Sampling the metric values lets you validate whether your computations work along expected lines. Sampling also lets you determine if the metric can go live, and if the metric is ready to be used in analytics artifacts, such as anomalies and predictions.

    Computations are made using live data scheduling. Results may take a few minutes to compute and are available for two hours. Metric results may be shown for a sample selection of machines to cover the range of metric values.

  13. Click Save.
    Your metric is saved and you can add it to the toolbar in the Map view.

Add the new metric to the Metrics toolbar in the Map view:

  1. In the Map view, click the Edit icon located in the Metrics toolbar.
  2. Drag and drop your new metric from the Unused Metrics group to an existing group.
    To drag and drop a metric, click on the ... located above the metric’s value.
    You can add your metric to an existing group, or create a new one by clicking the Add icon next to the existing groups.

Use Duration Tracker Metrics

Duration tracker metrics let you track machine state durations based on the conditions you specify. The metric conditions can use sensor attribute values, dynamic attribute values, and other user-defined or system-defined metrics.

Your manufacturing scenario may require you to track the duration of time for which a machine remains inactive, or sensor attribute values remain out of range.

Like formula-based metrics, you can add duration tracker metrics to your dashboards. You can also use duration tracker metrics in your rule conditions to generate incidents, warnings, and alerts if a threshold duration is crossed.

For example, you may wish to track the time duration for which the pressure sensor readings remain out of range. You can create a duration-based metric and add it to the machine dashboard. You can also create a rule to generate a warning or an incident if the sensor values remain out of range beyond the threshold duration that you specify.

Create a Duration Tracker Metric

The metric editor can be used to create a duration tracker metric for one or more machines of a machine type.

  1. Click Menu (Menu icon), and then click Design Center.
  2. Select Machine Types from the Design Center sub-menu.
  3. Select a machine type from the Machine Types list.
    You can also search for a machine type.
  4. Click Metrics.
  5. Click Create Metric Add icon.
  6. Enter a Name to identify the new metric.
  7. (Optional) Enter a Description for the metric.
  8. Select Duration Based under Metric Type.
  9. (Optional) Select a value under Keep Metric Data For.
    If you have unique storage requirements for historical data related to this metric, you can select an option that is different from the global settings defined under Storage Management on the application Settings page.
    For example, if you are calculating frequent metrics across a large number of machines, and the metric data is not required beyond a week, then you can select 7 Days under Keep Metric Data For to optimize storage.
  10. Select a Mode for the duration based metric:
    • Live: The time duration for which the metric conditions are currently being met. If the metric conditions are currently not met, then the Live value is zero.
    • Last: The time duration for which the metric conditions were last met.

      When the metric conditions go from currently being met to currently not being met, the value of Live is transferred to Last, and the Live value becomes zero.

    • Cumulative: The total time duration of all occurrences when the metric conditions were met.

      If you select Cumulative, you also need to select a Time Window. The cumulative occurrences are tracked over the Time Window you select. For example, if you select Weekly, then the total time duration of all occurrences over the past week is tracked.

    You can select more than one mode if required.
  11. Under Target, select All Machines of Type: MachineType to calculate the metric for each machine of the machine type. Alternatively, select Specific Machines of Type: MachineType and click Select to select one or more machines that you wish to monitor.
    You can hold down the Ctrl key to select more than one machine name.
  12. Under Conditions, add one or more conditions.
    You can create threshold conditions based on whether a sensor attribute, or pre-existing metric, exceeds a set threshold. You can create threshold conditions for dynamic attributes, too.
    To create a threshold condition:
    1. Select a machine sensor attribute or existing metric from the drop-down list.
    2. Select a threshold condition for the attribute in the second drop-down list.

      For example, a numeric attribute specifies conditions like Greater Than and Less Than.

    3. Specify an attribute value in the third field.

      For example, a complete condition may look like: maxtemp Greater Than 50.

      A complete condition that uses a system metric may look like: sys_machineInactiveDuration Greater Than 60000. Here, 60,000 milliseconds represent 60 seconds.

  13. (Optional) Add additional conditions, as required.
  14. In the Fulfillment section, select an option for the Fulfill when field:
    • All Conditions Apply : Select this option to track the duration when all the conditions are met.

    • Any Conditions Apply: Select this option to track the duration when any of the conditions are met.


    Duration Based Metric: Described in Text

    The preceding example shows the metric editor for a duration-based metric. The duration is tracked when the pressure sensor reading is greater than 12.

  15. Click Save to create the metric.
You can next add the newly created metric to your dashboards, or use the metric in rule conditions.