Skip to content

Row Total ​

Add a total row using ALL in the ROWS clause.

Interactive Example ​

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

Query Breakdown ​

  • (occupation | ALL) - Shows each occupation value plus a total row at the bottom
  • COLS education * gender * income.sum - Nested column headers without totals

The parentheses group the dimension with its total. The | operator concatenates the individual values with the ALL aggregate row.

Powered by Malloy and DuckDB