Sheet kit command

pivot.insert

Pivot table

Creates a pivot table from a source range or table (default: around the selection) on a new sheet or at a destination, optionally with rows, columns and values.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
yes

Parameters

Parameters of pivot.insert
NameTypeRequiredDescription
columnsany[]no
destination"new" | "Sheet1!H3"nodefault: new sheet before the current one, report at A3
filtersany[]no[field]
namestringno
replacebooleanno
rowsany[]no[field | {field, group?: years|quarters|months|days}]
sourcestringnoa range in A1 notation such as Sheet1!$A$1:$E$200, or a table name
valuesany[]no[field | {field, func?, name?}]

Call through sheet_run

text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "pivot.insert" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: columns, destination, filters, name, replace, rows, source, values. sheet_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "columns": {
      "items": {},
      "type": "array"
    },
    "destination": {
      "description": "default: new sheet before the current one, report at A3",
      "enum": [
        "new",
        "Sheet1!H3"
      ],
      "type": "string"
    },
    "filters": {
      "description": "[field]",
      "items": {},
      "type": "array"
    },
    "name": {
      "type": "string"
    },
    "replace": {
      "type": "boolean"
    },
    "rows": {
      "description": "[field | {field, group?: years|quarters|months|days}]",
      "items": {},
      "type": "array"
    },
    "source": {
      "description": "a range in A1 notation such as Sheet1!$A$1:$E$200, or a table name",
      "type": "string"
    },
    "values": {
      "description": "[field | {field, func?, name?}]",
      "items": {},
      "type": "array"
    }
  },
  "returns": "{id, name, sheet, anchor, fields}",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (sheet_commands through @kition/[email protected], built from KitionAI/kition-sheet@82f13b2). As data: commands.jsonl.