Open Presentation

Search docs

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

    Data Link

    A number computed from a dataset of this deck: 'aggregate' over the cells of 'field' in the rows that meet 'filter'. Engines compute it from the embedded rows and never fetch. The shape every content that can be linked to data shares; MetricData is this shape plus a change.

    Metadata

    Definition
    #/$defs/DataLink
    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: 'count' is the number of rows kept (cells included whatever they hold); 'sum' and 'mean' read numbers (in a column with no declared type also strings in strict decimal syntax); 'min' and 'max' read numbers, or time labels in a 'date' column; 'first' and 'last' are the first or last cell that is not null, in dataset order. A column typed 'text' or 'boolean' refuses 'sum', 'mean', 'min' and 'max' ('metric-data-aggregate' warning).
    aggregate · Allowed values
    "sum""mean""min""max""count""first""last"
    filterref:DataFilter—Only the rows that meet every condition are used. Absent: every row.

    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: 'count' is the number of rows kept (cells included whatever they hold); 'sum' and 'mean' read numbers (in a column with no declared type also strings in strict decimal syntax); 'min' and 'max' read numbers, or time labels in a 'date' column; 'first' and 'last' are the first or last cell that is not null, in dataset order. A column typed 'text' or 'boolean' refuses 'sum', 'mean', 'min' and 'max' ('metric-data-aggregate' warning).

    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"
    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "dataset",
        "field",
        "aggregate"
      ],
      "description": "A number computed from a dataset of this deck: 'aggregate' over the cells of 'field' in the rows that meet 'filter'. Engines compute it from the embedded rows and never fetch. The shape every content that can be linked to data shares; MetricData is this shape plus a change.",
      "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: 'count' is the number of rows kept (cells included whatever they hold); 'sum' and 'mean' read numbers (in a column with no declared type also strings in strict decimal syntax); 'min' and 'max' read numbers, or time labels in a 'date' column; 'first' and 'last' are the first or last cell that is not null, in dataset order. A column typed 'text' or 'boolean' refuses 'sum', 'mean', 'min' and 'max' ('metric-data-aggregate' warning)."
        },
        "filter": {
          "$ref": "#/$defs/DataFilter",
          "description": "Only the rows that meet every condition are used. Absent: every row."
        }
      }
    }