Skip to content

Column Concatenation ​

The | operator on columns creates side-by-side column groups. Here gender and occupation appear as separate column sections.

Interactive Example ​

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

Query Breakdown ​

  • TABLE - Declares a crosstab table statement
  • ROWS education - Row dimension: education levels become row headers
  • COLS (gender | occupation) - Column concatenation: gender columns appear first, then occupation columns as a separate group
  • income.sum - Measure: sum of income values for each cell

The | operator creates sibling column sections that appear side-by-side, unlike * which nests dimensions hierarchically.

Powered by Malloy and DuckDB