Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Pivot Table

data.pivot_table

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

When you send tabular rows, grouping fields, and aggregation specs, we return a pivot summary with count, count_distinct, sum, avg, min, or max — sorted by group key and capped at maxGroups. Numeric aggregations reject non-numeric values. Do not use this for formula languages or locale-dependent number parsing.

You need reproducible summaries without writing aggregation code in every agent.

Reliability

Same rows and same spec give the same table back, groups in the same sorted order. count counts rows in the group whatever field names, and count_distinct skips nulls. Sums and averages use double-precision floating point, so long decimal columns can carry a small rounding tail. We are strict about numbers: sum, avg, min and max accept JSON numbers only, and a numeric string such as "10" stops the call — reach for data.aggregate if you need numbers parsed out of text. None of the refusals are worth retrying unchanged: we stop when rowFields or aggregations is empty, a measure names a function we do not know or omits field, a value we must add up is not a number, the grouping produces more than maxGroups buckets (raise maxGroups up to 100,000 or group on fewer columns), or you send more than 200,000 rows.

Context footprint

Returns pivot rows, groupCount, and warnings. A successful call costs 1 execution credit.

When to use it

For bounded tabular data and explicit group/aggregation specs.

When groups may exceed maxGroups or values need locale-aware parsing.

Scope

Note
Aggregates tabular rows into a deterministic pivot summary.

Non-goals

  • No formula or expression language
  • No implicit locale-specific number parsing
  • Does not stream unbounded datasets

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisdata-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input195.3 KB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
rowsarrayYesBounded array of 0 through 200000 input row objects keyed by column name, where missing keys count as null.
rowFieldsarrayYesBounded non-empty array of column names whose combined values make one output row.
columnFieldsarrayNoBounded array of columns spread across the row as labelled measure prefixes; omit it for plain measure names.
aggregationsarrayYesBounded non-empty array of closed measures computed for each group.
includeTotalsbooleanNoWhether a grand-total row is appended; omit it for false.
maxGroupsintegerNoMaximum distinct groups; omit it for 10000.

Output schema

FieldTypeRequiredDescription
rowsarrayYesBounded array of 0 through 200000 result row objects keyed by column name after this skill transformed the table.
groupCountintegerYesHow many groups were found, excluding any grand-total row.
warningsarrayYesBounded array of 0 through 16 closed warnings with code and message.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.pivot_table","input":{"rows":[{"cat":"a"},{"cat":"a"},{"cat":"b"}],"rowFields":["cat"],"aggregations":[{"field":"cat","function":"count","as":"n"}]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("data.pivot_table", {"rows":[{"cat":"a"},{"cat":"a"},{"cat":"b"}],"rowFields":["cat"],"aggregations":[{"field":"cat","function":"count","as":"n"}]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • No formula or expression language
  • No implicit locale-specific number parsing
  • Does not stream unbounded datasets
  • Streaming aggregation of huge datasets
  • Spreadsheet-style calculated fields

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "data.pivot_table",
  "input": {
    "rows": [
      {
        "cat": "a"
      },
      {
        "cat": "a"
      },
      {
        "cat": "b"
      }
    ],
    "rowFields": [
      "cat"
    ],
    "aggregations": [
      {
        "field": "cat",
        "function": "count",
        "as": "n"
      }
    ]
  }
}

Examples

Count rows per category

Inputjson
{
  "rows": [
    {
      "cat": "a"
    },
    {
      "cat": "a"
    },
    {
      "cat": "b"
    }
  ],
  "rowFields": [
    "cat"
  ],
  "aggregations": [
    {
      "field": "cat",
      "function": "count",
      "as": "n"
    }
  ]
}
Expected outputjson
{
  "rows": [
    {
      "cat": "a",
      "n": 2
    },
    {
      "cat": "b",
      "n": 1
    }
  ],
  "warnings": [],
  "groupCount": 2
}

Sum amount per category

Inputjson
{
  "rows": [
    {
      "cat": "a",
      "amt": 10
    },
    {
      "cat": "a",
      "amt": 5
    }
  ],
  "rowFields": [
    "cat"
  ],
  "aggregations": [
    {
      "field": "amt",
      "function": "sum",
      "as": "total"
    }
  ]
}
Expected outputjson
{
  "rows": [
    {
      "cat": "a",
      "total": 15
    }
  ],
  "warnings": [],
  "groupCount": 1
}
  • Quick group-by counts for reporting
  • Sum or average by category
  • Agent-generated summaries without hand-written code

Avoid for

  • Streaming aggregation of huge datasets
  • Spreadsheet-style calculated fields

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

pivotstatisticsdata