1
0

median.asciidoc 675 B

12345678910111213141516171819202122
  1. [discrete]
  2. [[esql-agg-median]]
  3. === `MEDIAN`
  4. The value that is greater than half of all values and less than half of
  5. all values, also known as the 50% <<esql-agg-percentile>>.
  6. [source.merge.styled,esql]
  7. ----
  8. include::{esql-specs}/stats_percentile.csv-spec[tag=median]
  9. ----
  10. [%header.monospaced.styled,format=dsv,separator=|]
  11. |===
  12. include::{esql-specs}/stats_percentile.csv-spec[tag=median-result]
  13. |===
  14. NOTE: Like <<esql-agg-percentile>>, `MEDIAN` is <<esql-agg-percentile-approximate,usually approximate>>.
  15. [WARNING]
  16. ====
  17. `MEDIAN` is also {wikipedia}/Nondeterministic_algorithm[non-deterministic].
  18. This means you can get slightly different results using the same data.
  19. ====