Reverse Alphabetic Limit ​
Use [-N] to show the last N values in descending order.
Definition Order for DIMENSION
For dimensions defined with DIMENSION syntax, this uses reverse definition order, not reverse alphabetical order. The values appear in the opposite order from how buckets are declared in the DIMENSION statement.
This example shows the last 5 occupations from the occupation dimension (reverse definition order: Farming, Transport, Manufacturing, Services, ...).
Interactive Example ​
Try It
TABLE ROWS occupation[-5] COLS education * gender * income.sum ;
Dataset:
samplesoccupation, education, gender, incomeTry Variations
Query Breakdown ​
TABLE- Declares a crosstab table statementROWS occupation[-5]- Last 5 occupations[-5]- Negative number means descending order, limit to 5- For
DIMENSION-defined dimensions, uses reverse definition order - For raw columns, uses reverse alphabetic order (Z-A)
COLS education * gender * income.sum- Three-level column hierarchyincome.sum- Measure: sum of income for each cell
The sign of the number controls direction: [5] gives first N, [-5] gives last N. For dimensions defined with DIMENSION syntax, ordering follows definition order by default. Add @aggregate to order by value instead.
Related Examples ​
- Alphabetic Limit - First N values alphabetically
- Top N by Value - Limit by computed value instead
- Column Limits - Apply limits to column dimensions