mv_avg.asciidoc 439 B

1234567891011121314151617
  1. [discrete]
  2. [[esql-mv_avg]]
  3. === `MV_AVG`
  4. Converts a multivalued field into a single valued field containing the average
  5. of all of the values. For example:
  6. [source.merge.styled,esql]
  7. ----
  8. include::{esql-specs}/math.csv-spec[tag=mv_avg]
  9. ----
  10. [%header.monospaced.styled,format=dsv,separator=|]
  11. |===
  12. include::{esql-specs}/math.csv-spec[tag=mv_avg-result]
  13. |===
  14. NOTE: The output type is always a `double` and the input type can be any number.