Skip to content

Value and Percentage ​

Show both raw values and percentages side by side using the pipe operator.

Interactive Example ​

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

Query Breakdown ​

  • ROWS occupation * gender - Creates row hierarchy with occupation and gender
  • COLS education - Education levels as columns
  • income.sum | (income.sum ACROSS COLS) - Pipe operator concatenates two measures: raw sum and row percentage

The pipe operator | places multiple measures side by side. This pattern is useful when you need both absolute values and their relative proportions for comparison.

Powered by Malloy and DuckDB