Skip to content

Row Nesting ​

The * operator nests dimensions to create hierarchies. Here occupation contains gender as a sub-grouping.

Interactive Example ​

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

Query Breakdown ​

  • TABLE - Declares a crosstab table statement
  • ROWS occupation * gender - Row hierarchy: occupation is the outer dimension, gender is nested within each occupation
  • COLS education - Column dimension: education levels become column headers
  • income.sum - Measure: sum of income values for each cell

The * operator creates a parent-child relationship where each occupation value contains all gender values beneath it.

Powered by Malloy and DuckDB