Open Presentation

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Metric Data

    A DataLink for a metric, with an optional change. The DataLink properties, repeated because both definitions are closed, plus 'delta'.

    Metadata

    Definition
    #/$defs/MetricData
    Form
    object
    Source
    spec/schemas/opf.schema.json

    Field index

    FieldTypeReq.Description
    datasetref:DatasetIdyesId of the dataset. An unknown id is a 'dataset-unknown' error.
    fieldstringyesThe column whose cells are aggregated. An unknown name is a 'dataset-field-unknown' error.
    aggregateenumyesHow the cells are combined; see DataLink.
    aggregate · Allowed values
    "sum""mean""min""max""count""first""last"
    filterref:DataFilter—Only the rows that meet every condition are used. Absent: every row.
    deltaref:MetricDelta—How the metric's change is computed. Absent: no change is computed, and a typed 'delta' on the metric is drawn as written.

    dataset

    typeref:DatasetIdrequiredyesdefault—

    Id of the dataset. An unknown id is a 'dataset-unknown' error.

    field

    typestringrequiredyesdefault—

    The column whose cells are aggregated. An unknown name is a 'dataset-field-unknown' error.

    field.json
    {
      "field": "ARR"
    }

    aggregate

    typeenumrequiredyesdefault—

    How the cells are combined; see DataLink.

    aggregate · Allowed values
    "sum""mean""min""max""count""first""last"
    aggregate.json
    {
      "aggregate": "sum"
    }

    filter

    typeref:DataFilterrequirednodefault—

    Only the rows that meet every condition are used. Absent: every row.

    filter[].op · Allowed values
    "=""!=""<""<="">"">=""in"

    delta

    typeref:MetricDeltarequirednodefault—

    How the metric's change is computed. Absent: no change is computed, and a typed 'delta' on the metric is drawn as written.

    delta.compare · Named choices (see schema for other values and constraints)
    "previous"
    delta.compare (oneOf 2).filter[].op · Allowed values
    "=""!=""<""<="">"">=""in"
    delta.as · Allowed values
    "difference""percent"
    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dataset",
        "field",
        "aggregate"
      ],
      "description": "A DataLink for a metric, with an optional change. The DataLink properties, repeated because both definitions are closed, plus 'delta'.",
      "properties": {
        "dataset": {
          "$ref": "#/$defs/DatasetId",
          "description": "Id of the dataset. An unknown id is a 'dataset-unknown' error."
        },
        "field": {
          "type": "string",
          "description": "The column whose cells are aggregated. An unknown name is a 'dataset-field-unknown' error.",
          "examples": [
            "ARR"
          ]
        },
        "aggregate": {
          "type": "string",
          "enum": [
            "sum",
            "mean",
            "min",
            "max",
            "count",
            "first",
            "last"
          ],
          "description": "How the cells are combined; see DataLink."
        },
        "filter": {
          "$ref": "#/$defs/DataFilter",
          "description": "Only the rows that meet every condition are used. Absent: every row."
        },
        "delta": {
          "$ref": "#/$defs/MetricDelta",
          "description": "How the metric's change is computed. Absent: no change is computed, and a typed 'delta' on the metric is drawn as written."
        }
      },
      "examples": [
        {
          "dataset": "arr",
          "field": "ARR",
          "aggregate": "last",
          "filter": [
            {
              "field": "Region",
              "op": "=",
              "value": "EMEA"
            }
          ],
          "delta": {
            "compare": "previous"
          }
        }
      ]
    }