@@ -75,7 +75,7 @@ and then grouping - that is not going to be faster.
7575::: :
7676
7777
78- ** Examples**
78+ # ## Examples
7979
8080Calculating a statistic and grouping by the values of another column :
8181
@@ -104,15 +104,17 @@ optional as well:
104104:::{include} ../examples/stats.csv-spec/aggFilteringNoGroup.md
105105:: :
106106
107- $$$esql-stats-mv-group$$$
108- If the grouping key is multivalued then the input row is in all groups :
107+ It’s also possible to group by multiple values :
109108
110- :::{include} ../examples/stats.csv-spec/mv-group .md
109+ :::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues .md
111110:: :
112111
113- It’s also possible to group by multiple values :
112+ $$$esql-stats-mv-group$$$
113+ # ### Multivalued inputs
114114
115- :::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues.md
115+ If the grouping key is multivalued then the input row is in all groups :
116+
117+ :::{include} ../examples/stats.csv-spec/mv-group.md
116118:: :
117119
118120If all the grouping keys are multivalued then the input row is in all groups :
@@ -132,6 +134,11 @@ key. If you want to send the group key to the function then `MV_EXPAND` first:
132134:::{include} ../examples/stats.csv-spec/mv-group-values-expand.md
133135:: :
134136
137+ Refer to [elasticsearch/issues/134792](https://github.com/elastic/elasticsearch/issues/134792#issuecomment-3361168090)
138+ for an even more in depth explanation.
139+
140+ # ### Multivalue functions
141+
135142Both the aggregating functions and the grouping expressions accept other
136143functions. This is useful for using `STATS` on multivalue columns.
137144For example, to calculate the average salary change, you can use `MV_AVG` to
@@ -147,6 +154,8 @@ letter of their last name:
147154:::{include} ../examples/stats.csv-spec/docsStatsByExpression.md
148155:: :
149156
157+ # ### Naming
158+
150159Specifying the output column name is optional. If not specified, the new column
151160name is equal to the expression. The following query returns a column named
152161`AVG(salary)` :
0 commit comments