Skip to content

Full Marginals ​

Complete table with totals on both rows and columns for comprehensive summaries.

Interactive Example ​

Try It
TABLE
  WHERE occupation IS NOT NULL
  ROWS (occupation | ALL) * (gender | ALL)
  COLS (education | ALL) * income.sum
;
Dataset:samplesoccupation, education, gender, income
Try Variations

Query Breakdown ​

  • (occupation | ALL) - Adds a grand total row after all occupations
  • (gender | ALL) - Adds a subtotal row for each occupation showing both genders combined
  • (education | ALL) - Adds a grand total column after all education levels
  • * income.sum - The measure displayed in all cells

Placing ALL at multiple nesting levels creates a complete marginal table with subtotals at each hierarchy level and grand totals at the edges.

Powered by Malloy and DuckDB