Sheet kit command

data.consolidate

Consolidate

Combines several source ranges into one at a destination with a function (sum, average, count…), matching by top row and left column labels when asked.

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

Parameters

Parameters of data.consolidate
NameTypeRequiredDescription
destinationstringnolike A1; default active cell
functionstringno
leftColumnbooleannoconsolidate by labels; else by position
sourcesany[]no["Sheet2!A1:C10", ..]
topRowbooleanno

Call through sheet_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: destination, function, leftColumn, sources, topRow. 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": {
    "destination": {
      "description": "like A1; default active cell",
      "type": "string"
    },
    "function": {
      "type": "string"
    },
    "leftColumn": {
      "description": "consolidate by labels; else by position",
      "type": "boolean"
    },
    "sources": {
      "description": "[\"Sheet2!A1:C10\", ..]",
      "type": "array"
    },
    "topRow": {
      "type": "boolean"
    }
  },
  "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.