1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- [discrete]
- [[esql-mv_median]]
- === `MV_MEDIAN`
- [source,esql]
- ----
- MV_MEDIAN(v)
- ----
- *Parameters*
- `v`::
- Multivalue expression.
- *Description*
- Converts a multivalued column into a single valued column containing the median
- value.
- *Supported types*
- include::types/mv_median.asciidoc[]
- *Examples*
- [source.merge.styled,esql]
- ----
- include::{esql-specs}/math.csv-spec[tag=mv_median]
- ----
- [%header.monospaced.styled,format=dsv,separator=|]
- |===
- include::{esql-specs}/math.csv-spec[tag=mv_median-result]
- |===
- If the row has an even number of values for a column, the result will be the
- average of the middle two entries. If the column is not floating point, the
- average rounds *down*:
- [source.merge.styled,esql]
- ----
- include::{esql-specs}/math.csv-spec[tag=mv_median_round_down]
- ----
- [%header.monospaced.styled,format=dsv,separator=|]
- |===
- include::{esql-specs}/math.csv-spec[tag=mv_median_round_down-result]
- |===
|