Sheet kit command

pivot.valueSettings

Value Field Settings

Changes a pivot table value field's summary function, caption or show-as calculation (percent of total, running total…).

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

Parameters

Parameters of pivot.valueSettings
NameTypeRequiredDescription
fieldstringnoa source field name or a value field caption
funcstringno
indexintegernoone of several alternative parameters
namestringno
numberFormatstringnoa number format code such as #,##0
pivotstring | integernodefault: the pivot table at the active cell
replacebooleannoreplace the existing pivot table output in place
showAs"normal" | "percentOfGrandTotal" | "percentOfColumnTotal" | "percentOfRowTotal" | "runningTotal" | "rank"no

Call through sheet_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: field, func, index, name, numberFormat, pivot, replace, showAs. 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": {
    "field": {
      "description": "a source field name or a value field caption",
      "type": "string"
    },
    "func": {
      "type": "string"
    },
    "index": {
      "description": "one of several alternative parameters",
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "numberFormat": {
      "description": "a number format code such as #,##0",
      "type": "string"
    },
    "pivot": {
      "description": "default: the pivot table at the active cell",
      "oneOf": [
        {
          "description": "a pivot table name",
          "type": "string"
        },
        {
          "description": "a pivot table id",
          "type": "integer"
        }
      ]
    },
    "replace": {
      "description": "replace the existing pivot table output in place",
      "type": "boolean"
    },
    "showAs": {
      "enum": [
        "normal",
        "percentOfGrandTotal",
        "percentOfColumnTotal",
        "percentOfRowTotal",
        "runningTotal",
        "rank"
      ],
      "type": "string"
    }
  },
  "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.