Skip to content

Median (P50) ​

Use median or p50 to compute the 50th percentile (median) of a measure.

Interactive Example ​

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

Query Breakdown ​

  • TABLE - Declares a crosstab table statement
  • ROWS occupation - Occupation values become row headers
  • income.median - Computes the 50th percentile (median) of income

The median is less sensitive to outliers than the mean. median and p50 are interchangeable.

Powered by Malloy and DuckDB