Skip to content

docs: document per-group subtotals for table chart row grouping - #11648

Open
igorlukanin wants to merge 1 commit into
masterfrom
igor/docs-table-chart-group-subtotals
Open

docs: document per-group subtotals for table chart row grouping#11648
igorlukanin wants to merge 1 commit into
masterfrom
igor/docs-table-chart-group-subtotals

Conversation

@igorlukanin

Copy link
Copy Markdown
Member

Summary

  • Documents per-group subtotals for the table chart's row grouping: the Subtotals (Σ) toggle adds an aggregated value for every measure to each group header row, at every nesting level.
  • Spells out the part that surprises people: each subtotal is queried at its own group's grain rather than summed from the rows below, so an avg is a true average rather than an average of averages and a count_distinct counts a value once across child groups. A subtotal can therefore legitimately differ from the sum of the rows beneath it.
  • Notes the limits: window-function measures and period-comparison columns stay empty on group rows, and the toggle needs grouping active with values placed in columns.

Test plan

  • Section added under the existing Row grouping heading, next to the control it describes
  • Docs preview renders

@igorlukanin
igorlukanin requested a review from keydunov as a code owner August 25, 2026 16:37
@mintlify

mintlify Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
cubed3 🟢 Ready View Preview Aug 25, 2026, 4:38 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@claude

claude Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @igorlukanin's task in 1m 24s —— View job


Review: docs-only, no blockers — 0 high, 2 medium, 2 low

Prose is accurate and well-pitched; the non-additive-measure explanation is the right thing to spell out. Four inline comments, none blocking.

Full review

Todos

  • Gather context (diff, surrounding page, related docs)
  • Classify request — code review, no implementation
  • Check anchors, terminology, and cross-page consistency
  • Check for stale/duplicate prior threads (none existed)
  • Post inline comments and summary

Findings

# Severity Location Issue
1 Medium table.mdx:60 Two sections named "subtotals" on one page — ### Per-group subtotals (row grouping) vs ### Subtotals at line 519 (pivot). They share most of their semantics too, so nothing distinguishes them for a reader who lands on one. Suggested a disambiguating cross-link both ways.
2 Medium table.mdx:77 [totals](#totals) resolves, but this page's Totals section never mentions the window-function exclusion the sentence claims is "the same behavior". That fact lives in workbooks/querying-data.mdx:184.
3 Low table.mdx:52 Bullet now has a subsection behind it; link it to #per-group-subtotals.
4 Low table.mdx:81 The screenshot TODO got orphaned — it describes the Row grouping section but now sits under the new subsection.

Verified

  • #totals anchor exists (## Totals, line 515) — resolves correctly.
  • "values-as-rows" terminology matches existing usage in workbooks/querying-data.mdx:182, so it's consistent with the rest of the docs rather than newly invented here.
  • No docs.json change needed — this is a section on an existing page, not a new one.
  • Edits are confined to /docs-mintlify; /docs (legacy) untouched, per CLAUDE.md.
  • No code, tests, security, or performance surface in this PR.

Not verified

The behavioral claims (Σ toggle disabled conditions, period-comparison columns left empty, subtotals queried per group grain) describe Cube Cloud frontend behavior that isn't in this repo, so I couldn't check them against source. Worth a second pair of eyes from someone with the feature in hand.

· branch `igor/docs-table-chart-group-subtotals`


Measures built on window functions (`RUNNING_TOTAL`, `OFFSET`, or a SQL `OVER` clause)
can't be recomputed at another grain, so their cells stay empty on group rows — the same
behavior as [totals](#totals). Period-comparison columns are also left empty. The toggle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [totals](#totals) link points to the Totals section of this page (line 515), which doesn't say anything about window-function measures being excluded — so "the same behavior as totals" sends the reader somewhere that doesn't confirm the claim. The place that actually documents it is workbooks/querying-data.mdx:184 ("Calculations based on window functions, such as Running total, are excluded — same as for row and column totals"), i.e. /docs/explore-analyze/workbooks/querying-data#subtotals.

Either link there instead, or add the exclusion to this page's Totals section so the anchor pays off.

open or closed. It only sets the default — a viewer's own expand/collapse of an
individual group isn't affected by changing it afterwards.

### Per-group subtotals

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page now has two sections named "subtotals" describing two different features: ### Per-group subtotals here (row-grouping, per group header row) and ### Subtotals at line 519 under Totals (pivot, a Total for ‹value› column per pivot group). They also share most of their semantics — computed at their own grain rather than summed, window functions excluded, unavailable in values-as-rows — so a reader who lands on one has no way to tell it isn't the other.

Worth a one-line disambiguating cross-link in both directions, e.g. here: "Not to be confused with pivot subtotals, which add a column per pivot group rather than a value per group header row." Related: line 511 already says "the row totals and subtotal columns", which becomes ambiguous once both features exist on the page.

Turning it on also adds a **Row grouping** section to the **Style** tab, with:

- **Expand all groups** / **Collapse all groups** — set every group's expand state at once.
- **Subtotals** (Σ) — show an aggregated value for every measure on each group header row.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the other bullets in this list are self-contained, but this one now has a whole subsection behind it. Linking it saves the reader from having to notice the section below.

Suggested change
- **Subtotals** (Σ) — show an aggregated value for every measure on each group header row.
- **Subtotals** (Σ) — show an aggregated value for every measure on each group header row. See [Per-group subtotals](#per-group-subtotals).

is disabled unless grouping is active and the values are placed in columns, since the
values-as-rows layout has no per-measure column for a subtotal to sit under.

{/* TODO screenshot: table with collapsed row groups and the Style tab's Row grouping section */}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this TODO previously sat directly after the Row grouping prose it illustrates ("table with collapsed row groups and the Style tab's Row grouping section"). Inserting ### Per-group subtotals above it means it now reads as belonging to the subtotals subsection. Moving it back up to line 59 (before the new heading) keeps it attached to what it depicts — or reword it to cover the Σ toggle too, since a screenshot of the Row grouping section will show that control anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant