Skip to content

Commit a0c76aa

Browse files
committed
Move
1 parent d267893 commit a0c76aa

File tree

1 file changed

+11
-10
lines changed
  • docs/reference/query-languages/esql/_snippets/commands/layout

1 file changed

+11
-10
lines changed

docs/reference/query-languages/esql/_snippets/commands/layout/stats-by.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,19 @@ optional as well:
104104
:::{include} ../examples/stats.csv-spec/aggFilteringNoGroup.md
105105
:::
106106

107+
It’s also possible to group by multiple values:
108+
109+
:::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues.md
110+
:::
111+
107112
$$$esql-stats-mv-group$$$
108-
#### Multivalued
113+
#### Multivalued inputs
109114

110115
If the grouping key is multivalued then the input row is in all groups:
111116

112117
:::{include} ../examples/stats.csv-spec/mv-group.md
113118
:::
114119

115-
It’s also possible to group by multiple values:
116-
117-
:::{include} ../examples/stats.csv-spec/statsGroupByMultipleValues.md
118-
:::
119-
120120
If all the grouping keys are multivalued then the input row is in all groups:
121121

122122
:::{include} ../examples/stats.csv-spec/multi-mv-group.md
@@ -134,6 +134,11 @@ key. If you want to send the group key to the function then `MV_EXPAND` first:
134134
:::{include} ../examples/stats.csv-spec/mv-group-values-expand.md
135135
:::
136136

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+
137142
Both the aggregating functions and the grouping expressions accept other
138143
functions. This is useful for using `STATS` on multivalue columns.
139144
For example, to calculate the average salary change, you can use `MV_AVG` to
@@ -149,10 +154,6 @@ letter of their last name:
149154
:::{include} ../examples/stats.csv-spec/docsStatsByExpression.md
150155
:::
151156

152-
Note: This can get confusing if you do something like `| STATS a + SUM(a) BY a`
153-
if `a` is multivalued. If you do that and are having trouble see
154-
[github](https://github.com/elastic/elasticsearch/issues/134792#issuecomment-3361168090).
155-
156157
#### Naming
157158

158159
Specifying the output column name is optional. If not specified, the new column

0 commit comments

Comments
 (0)