add_pivot_table
Create a pivot table from source data in Google Sheets by specifying source range, row grouping, value aggregation columns, and target location.
Instructions
Create a pivot table from source data.
Args: spreadsheet_id: The ID of the spreadsheet source_sheet: Sheet name containing source data source_range: A1 range of source data (e.g., 'A1:E100') target_sheet: Sheet name to place the pivot table target_cell: Cell to anchor the pivot table (default 'A1') row_columns: List of 0-based column indices for row grouping (e.g., [0, 1]) value_columns: List of 0-based column indices to aggregate (e.g., [3, 4]) aggregation: Aggregation function — 'SUM', 'COUNTA', 'AVERAGE', 'MAX', 'MIN'
Returns: Result of the pivot table creation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spreadsheet_id | Yes | ||
| source_sheet | Yes | ||
| source_range | Yes | ||
| target_sheet | Yes | ||
| target_cell | No | A1 | |
| row_columns | No | ||
| value_columns | No | ||
| aggregation | No | SUM |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |