Adding a predefined metric to a view

Adding a predefined metric to a view consists of specifying the metric key and EQL definition.

On the Views page, to add a predefined metric to a view:

  1. From the Metrics list, click + Metric.

    The Create Metric Definition dialog displays.


    Create Metric Definition dialog
  2. On the Create Metric Definition dialog, in the Metric Key Name field, type the key name for the metric.

    The key name must be NCName-compliant.

    Once you save the new metric, you cannot change the key name.

  3. In the Display name field, type the display name for the metric.

    This is the name used to select the metric to add to a component. You can edit and localize the display name at any time.

  4. In the text area, type the EQL expression for calculating the predefined metric value.

    The expression is an EQL snippet that is inserted into a SELECT statement when a query using the predefined metric is issued. The snippet can only refer to attributes from the current view. For example:

    count(1) WHERE (SalesAmountSum > 3000000)
    

    To the right of the EQL text area is the list of attributes in the current view for you to use as a reference. You can show or hide the attribute list.

    For information on aggregation methods, including the EQL syntax for including them in predefined metrics, see Aggregation methods and the data types that can use them. For detailed information on EQL syntax, see the EQL Reference.

  5. To validate the expression, click Validate.

    If the expression is invalid, Studio displays error messages to help you troubleshoot.

  6. To confirm adding the metric, click Save.