Open Presentation

Search docs

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

    Data Condition

    One condition on a row: the row's cell in 'field' compared with 'value'. Nothing is parsed or evaluated. '=' and '!=' compare the same JSON value (null equals only null, 1 does not equal "1"); '<', '<=', '>' and '>=' compare two numbers as numbers, or two strings by the time order of a 'date' column ("2026-03" before "2026-11", "Q1 2026" before "Q3 2026") and else by code point, and any other pair does not meet the condition; 'in' is equal to one of the listed values.

    Metadata

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

    Field index

    FieldTypeReq.Description
    fieldstringyesA column name of the linked dataset. An unknown name is a 'dataset-field-unknown' error.
    openumyesHow the row's cell is compared with 'value'.
    op · Allowed values
    "=""!=""<""<="">"">=""in"
    valueref:ChartDataCell | array<ref:ChartDataCell>yesThe value to compare with. For 'in', a list of values.

    field

    typestringrequiredyesdefault—

    A column name of the linked dataset. An unknown name is a 'dataset-field-unknown' error.

    field.json
    {
      "field": "Region"
    }

    op

    typeenumrequiredyesdefault—

    How the row's cell is compared with 'value'.

    op · Allowed values
    "=""!=""<""<="">"">=""in"
    op.json
    {
      "op": "="
    }

    value

    typeref:ChartDataCell | array<ref:ChartDataCell>requiredyesdefault—

    The value to compare with. For 'in', a list of values.

    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "field",
        "op",
        "value"
      ],
      "description": "One condition on a row: the row's cell in 'field' compared with 'value'. Nothing is parsed or evaluated. '=' and '!=' compare the same JSON value (null equals only null, 1 does not equal \"1\"); '<', '<=', '>' and '>=' compare two numbers as numbers, or two strings by the time order of a 'date' column (\"2026-03\" before \"2026-11\", \"Q1 2026\" before \"Q3 2026\") and else by code point, and any other pair does not meet the condition; 'in' is equal to one of the listed values.",
      "properties": {
        "field": {
          "type": "string",
          "description": "A column name of the linked dataset. An unknown name is a 'dataset-field-unknown' error.",
          "examples": [
            "Region"
          ]
        },
        "op": {
          "type": "string",
          "enum": [
            "=",
            "!=",
            "<",
            "<=",
            ">",
            ">=",
            "in"
          ],
          "description": "How the row's cell is compared with 'value'."
        },
        "value": {
          "description": "The value to compare with. For 'in', a list of values.",
          "oneOf": [
            {
              "$ref": "#/$defs/ChartDataCell"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ChartDataCell"
              },
              "minItems": 1
            }
          ]
        }
      },
      "examples": [
        {
          "field": "Region",
          "op": "=",
          "value": "EMEA"
        },
        {
          "field": "Month",
          "op": "in",
          "value": [
            "2026-10",
            "2026-11"
          ]
        }
      ]
    }