create_interactive_pivot
Create a real Excel PivotTable with interactive drag-and-drop fields, expand/collapse, and refresh. Use it when static summaries and filters are not enough for exploring data.
Instructions
Create an INTERACTIVE PivotTable (a real Excel PivotTable object).
Difference from create_pivot (static summary):
create_pivot: writes aggregated numbers into cells - fast but staticcreate_interactive_pivot: injects real OOXML pivot parts, so in Excel you can drag fields, expand/collapse and refresh (structure validated with LibreOffice)
Args:
rows / columns / values: row / column (cross-tab) / value fields
agg_func: sum / count / average / min / max (default sum)
page_fields: report filter fields
filters: row filters (same format as filter_count)
target_sheet: target worksheet (created if missing)
location: top-left anchor (default A3)
LIMITATIONS:
Saving this file again with openpyxl (incl. this server's write_cells) will DROP the PivotTable - openpyxl cannot write pivot parts back. Generate it LAST.
Not supported: field grouping, calculated fields/items, slicers, timelines, multiple sources, data model.
LibreOffice recognizes it but interacts more weakly than Excel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| values | Yes | ||
| columns | No | ||
| filters | No | ||
| agg_func | No | sum | |
| location | No | A3 | |
| file_path | Yes | ||
| page_fields | No | ||
| source_sheet | No | ||
| target_sheet | No | PivotTable |