/pigment:aggregating-view-datafrom Pigment
Configures metric aggregation in Views: totals, subtotals, pivot vs hidden-dimension aggregation, and Advanced Aggregators on Table Views. Use when a metric rolls up incorrectly or a snapshot, ratio, or variance shows wrong totals.
Ships in Pigment. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Aggregation decides two things: what a total cell contains, and how a visible cell is computed when the metric carries dimensions the View does not display. It lives at two levels: metric defaults, set once on the metric, and View overrides, set per View with tool:update_view_aggregations.
Wrong aggregation never raises an error. It returns a plausible number, so check it whenever a metric is a snapshot, a rate, or a variance.
Read the current configuration with tool:get_views and include: ["Rows", "Columns", "HiddenDimensionsAggregations"]. Aggregation fields that fail validation are dropped silently, so re-read after every update.
| Dimension placement | Visible | Configure with | Creates total cells |
|---|---|---|---|
| Rows | yes | pivot aggregationConfigurations | yes, subtotals and grand total |
| Columns | yes | pivot aggregationConfigurations | yes |
| Pages | no | hiddenDimensionsAggregations | no |
| Not in the View at all | no | hiddenDimensionsAggregations | no |
Hidden-dimension aggregation adds no row and no column. It only decides how the visible cells fold away the dimensions you are not showing: a metric on Country x Month displayed by Month alone still has to collapse Country. Setting a pivot aggregation on a page is the most common mistake and does nothing.
The mirror mistake is quieter. A dimension the request names is usually visible, so its aggregator belongs on that pivot; putting it in hiddenDimensionsAggregations leaves the total cells you were asked about computing their default. And a calendar dimension is temporal: temporalDimensionsAggregator governs Month, Quarter and Year, otherDimensionsAggregator never does.
hiddenDimensionsAggregations takes one entry per value field: valueFieldId, temporalDimensionsAggregator, otherDimensionsAggregator.
Whether totals are displayed, and where, belongs to the Layout panel (tool:update_view_grid_layout), not here. Aggregation decides what they compute.
Every metric carries two default aggregators, set together through tool:create_metric / tool:bulk_update_metrics: one for temporal dimensions, one for all the others. Get them right and most Views need no override; at View level, Default means "inherit the metric".
| Metric kind | Temporal default | Non-temporal default |
|---|---|---|
| Additive flow (revenue, cost, units) | Sum | Sum |
| Snapshot (headcount, inventory, balance sheet) | Last | usually Sum |
| Reference or lookup (owner, status, category) | First, Last, or Any | same |
| Ratio, percentage, growth, variance | no correct simple default, see below | same |
Twelve monthly headcounts of 50 must read 50 for the year, not 600. Summing a snapshot across time is the classic wrong number.
Override at View level only when that View genuinely needs different behavior. A default that is wrong everywhere belongs on the metric, not patched View by View.
| Value type | Available aggregators |
|---|---|
| Decimal / Integer | Sum, Avg, Min, Max, Median, Stdevp, Stdevs, First, Last, FirstNonBlank, LastNonBlank, FirstNonZero, LastNonZero, the Count family, Blank, Default |
| Boolean | Any, All, First, Last, FirstNonBlank, LastNonBlank, the Count family, Blank, Default |
| Text | TextList, First, Last, FirstNonBlank, LastNonBlank, the Count family, Blank, Default |
| Date | Min, Max, First, Last, FirstNonBlank, LastNonBlank, the Count family, Blank, Default |
| Dimension, permission-like, access-right-like | First, Last, FirstNonBlank, LastNonBlank, the Count family, Blank, Default |
The Count family is Count, CountAll, CountUnique, CountBlank. OnlyOneNotNull and BitAnd also exist; use them only when the business meaning is explicit.
A rate, a percentage, a margin or a relative variance has no correct simple aggregator: the total of a ratio is not the sum of the ratios, nor their average. It needs an Advanced Aggregator, which recomputes the operation at every aggregated cell from two operand value fields.
Operations: Ratio, Growth, Product, Sum, Difference, AbsoluteDifference, AbsoluteGrowth.
Constraints, all hard:
tool:update_view_show_value_as - percent of another metric, percent of total, running total) restyles a value that already exists; it neither creates the value nor changes what a total computes. Any value that is one metric over another needs its own ratio metric plus a Ratio aggregator — never a show-value-as setting, never a bare formula left to aggregate itself.Run this whenever you add a metric to a Table View through tool:update_view_values. It is ratio-like if the name hints at it (%, rate, ratio, margin, growth, variance, GM%) or the formula divides or compares two metrics (A / B, DIVIDE, (A - B) / B). Use tool:search_metrics_and_lists with show_details: true to read the formula when unsure.
Ratio, with A the numerator and B the denominator, exactly as in the formula (GM% = Gross Margin / Revenue).Growth, with A the minuend of (A - B) / B and B the base.tool:update_view_values with three value fields: the ratio metric plus both operands. The operands may be displayed: false; keep them in values because the aggregator reads them.tool:update_view_aggregations with type: Advanced on the ratio value field: pivotAggregations for the visible Rows and Columns, and hiddenDimensionsAggregations for the dimensions on Pages or not shown. Never leave the default Sum.Repeat for every Table View that shows that metric. Nothing propagates from one View to another.
hiddenDimensionsAggregations.hiddenDimensionsAggregations to produce subtotal rows. It never creates a cell.Sum on a snapshot across time. Use Last.Sum or Avg on a rate or a percentage. Use Advanced Aggregator Ratio with the same numerator and denominator as the formula.Sum on a growth or relative variance. Use Advanced Aggregator Growth with the same A and B as the formula.Default.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gopigment/ai-plugins --plugin pigment39 skills in this plugin
/architecting-multi-application-solutionsPlanning skill. Use when deciding how to split work across Pigment applications, designing Hub-and-spoke data flows, or planning Test & Deploy across environments./auditing-a-pigment-applicationExecution skill. Use when auditing, reviewing, or health-checking a Pigment application. Covers the structured audit checklist, severity classification, and output format. Also triggers on requests to clean up, find unused blocks, assess model quality, or find what is wrong with an application./building-a-full-applicationPlanning skill. Use when building a complete Pigment application from scratch or when the request spans multiple modeling phases. This skill, together with any other planning skill the request calls for, is sufficient to produce the full architecture spec; do not load execution skills until the spec is approved and you begin building blocks.Other plugins' skills for the same job