elasticsearch/docs/reference/esql/functions/mv_avg.asciidoc

20 lines
408 B
Plaintext
Raw Normal View History

[[esql-mv_avg]]
=== `MV_AVG`
Converts a multivalued field into a single valued field containing the average
of all of the values. For example:
[source,esql]
----
include::{esql-specs}/math.csv-spec[tag=mv_avg]
----
Returns:
[%header,format=dsv,separator=|]
|===
include::{esql-specs}/math.csv-spec[tag=mv_avg-result]
|===
NOTE: The output type is always a `double` and the input type can be any number.