Basic Crosstab ​
The fundamental TPL pattern: row dimensions crossed with column dimensions to create a summary table.
Interactive Example ​
Try It
TABLE ROWS occupation COLS education * income.sum;
Dataset:
samplesoccupation, education, gender, incomeTry Variations
Query Breakdown ​
TABLE- Declares a crosstab table statementROWS occupation- Row dimension: occupation values become row headersCOLS education- Column dimension: education levels become column headersincome.sum- Measure: sum of income values populates each cell
The crosstab creates a matrix where each cell shows the sum of income for that specific combination of occupation and education level.
Related Examples ​
- Row Nesting - Nest dimensions within rows using
* - Column Nesting - Nest dimensions within columns
- Row Total - Add totals to your crosstab