Multiple Aggregates ​
Use | to show multiple aggregates as sibling columns. The parentheses group the aggregates together.
Interactive Example ​
Try It
TABLE ROWS occupation COLS education * (income.sum | income.mean);
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 outer column headers(income.sum | income.mean)- Multiple measures: sum and mean appear as sibling columns under each education level
The | operator concatenates measures horizontally, creating separate columns for each aggregate function applied to the same field.
Available Aggregations ​
TPL supports these aggregation methods:
| Method | Description |
|---|---|
sum | Sum of values |
mean / avg | Average |
count / n | Row count |
min | Minimum value |
max | Maximum value |
stdev | Standard deviation |
median / p50 | Median (50th percentile) |
p25 | First quartile (25th percentile) |
p75 | Third quartile (75th percentile) |
p90, p95, p99 | Higher percentiles |
Use them with the dot syntax: field.sum, field.mean, field.p50, etc.
Related Examples ​
- Median - 50th percentile aggregation
- Interquartile Range - P25, P50, P75 together
- Column Concatenation - Concatenate dimensions instead of measures
- Row Concatenation - Apply concatenation to rows
- Value and Percentage - Show value alongside its percentage