Open Presentation

Search docs

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

    Dataset Column

    A named data column: a dataset column or an inline chart data column. Adds to DataColumn what its cells hold (type), what it is for (role) and a unit label. The string form is { "name": value } with nothing declared. A table column header keeps DataColumn.

    Metadata

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

    Field index

    FieldTypeReq.Description
    namestringyesColumn label, used as the series name, the table header and the name 'fields', 'chart.mapping' and data links address.
    formatref:NumberFormat—Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form.
    typeenum—What the column's cells hold. text: strings. number: finite numbers (a string such as "12" is not one). date: time labels (a year, a period, a month, a week or a date, as the time-order rule reads them, and an ISO 8601 date-time). boolean: true or false. null is a gap in any type. A cell of another kind is a 'data-cell-type' warning. A date category column is drawn as time (the title fallback of the time-order rule is skipped); a text or boolean one never is. Absent: undeclared, read from the cells as before.
    type · Allowed values
    "text""number""date""boolean"
    roleenum—What the column is for. dimension: it labels or groups rows (a region, a product, a month). measure: its values are measured and can be aggregated (revenue, count, rate). Time is type 'date' with role 'dimension'. Absent: undeclared. Engines do not draw differently for a role; tools that pick a chart or aggregate a column read it.
    role · Allowed values
    "dimension""measure"
    unitstring—The unit of the column's values, as a label for tools: 'USD', 'ms', 'people'. Engines never print it; 'format' alone decides how a number is drawn.

    name

    typestringrequiredyesdefault—

    Column label, used as the series name, the table header and the name 'fields', 'chart.mapping' and data links address.

    name.json
    {
      "name": "Revenue"
    }

    format

    typeref:NumberFormatrequirednodefault—

    Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form.

    type

    typeenumrequirednodefault—

    What the column's cells hold. text: strings. number: finite numbers (a string such as "12" is not one). date: time labels (a year, a period, a month, a week or a date, as the time-order rule reads them, and an ISO 8601 date-time). boolean: true or false. null is a gap in any type. A cell of another kind is a 'data-cell-type' warning. A date category column is drawn as time (the title fallback of the time-order rule is skipped); a text or boolean one never is. Absent: undeclared, read from the cells as before.

    type · Allowed values
    "text""number""date""boolean"
    type.json
    {
      "type": "text"
    }

    role

    typeenumrequirednodefault—

    What the column is for. dimension: it labels or groups rows (a region, a product, a month). measure: its values are measured and can be aggregated (revenue, count, rate). Time is type 'date' with role 'dimension'. Absent: undeclared. Engines do not draw differently for a role; tools that pick a chart or aggregate a column read it.

    role · Allowed values
    "dimension""measure"
    role.json
    {
      "role": "dimension"
    }

    unit

    typestringrequirednodefault—

    The unit of the column's values, as a label for tools: 'USD', 'ms', 'people'. Engines never print it; 'format' alone decides how a number is drawn.

    unit.json
    {
      "unit": "USD"
    }
    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "description": "A named data column: a dataset column or an inline chart data column. Adds to DataColumn what its cells hold (type), what it is for (role) and a unit label. The string form is { \"name\": value } with nothing declared. A table column header keeps DataColumn.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Column label, used as the series name, the table header and the name 'fields', 'chart.mapping' and data links address.",
          "examples": [
            "Revenue",
            "Month"
          ]
        },
        "format": {
          "$ref": "#/$defs/NumberFormat",
          "description": "Number format of the column's number values (data labels, value axis, table cells, exported workbook). Absent: the General form."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "number",
            "date",
            "boolean"
          ],
          "description": "What the column's cells hold. text: strings. number: finite numbers (a string such as \"12\" is not one). date: time labels (a year, a period, a month, a week or a date, as the time-order rule reads them, and an ISO 8601 date-time). boolean: true or false. null is a gap in any type. A cell of another kind is a 'data-cell-type' warning. A date category column is drawn as time (the title fallback of the time-order rule is skipped); a text or boolean one never is. Absent: undeclared, read from the cells as before."
        },
        "role": {
          "type": "string",
          "enum": [
            "dimension",
            "measure"
          ],
          "description": "What the column is for. dimension: it labels or groups rows (a region, a product, a month). measure: its values are measured and can be aggregated (revenue, count, rate). Time is type 'date' with role 'dimension'. Absent: undeclared. Engines do not draw differently for a role; tools that pick a chart or aggregate a column read it."
        },
        "unit": {
          "type": "string",
          "minLength": 1,
          "description": "The unit of the column's values, as a label for tools: 'USD', 'ms', 'people'. Engines never print it; 'format' alone decides how a number is drawn.",
          "examples": [
            "USD",
            "ms",
            "people"
          ]
        }
      },
      "examples": [
        {
          "name": "Month",
          "type": "date",
          "role": "dimension"
        },
        {
          "name": "Revenue",
          "format": "$#,##0",
          "type": "number",
          "role": "measure",
          "unit": "USD"
        }
      ]
    }