You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The index from `Demo A` contains lineup statistics from basketball games. I use SQL to generate some simple
10
+
*[Demo C](Demos.md#demo-c)
11
+
* The index from `Demo A` contains lineup statistics from basketball games. I use [SQL](https://www.elastic.co/products/stack/elasticsearch-sql) to generate some simple
12
12
aggregations grouped by the lineup. I want to filter the statistics to be over only a certain class of opponent,
13
13
but that's ~30 teams so cumbersome to type by hand. So I build another `GROUP BY` SQL table just listing the teams,
14
-
use an adjacent column to specify the opponent class, turn that into a SQL query with Google Sheets' `CONCATENATE`
15
-
, `TEXTJOIN`, and `FILTER` functions, and then inject that query into the Table.
* I duplicate `Demo C` but using a combination of standard Elasticsearch aggregations (`terms` grouping, `sum` metric)
18
+
*[Part 1](Demos.md#part-1)
19
+
* I duplicate `Demo C` but using a combination of standard [Elasticsearch aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html) (`terms` grouping, `sum` metric)
20
20
and Map/Reduce (a UI over the top of `scripted_metric`)
* The reason for using a more complex Map/Reduce in `Part 1` was to be able to adjust the statistics based on
23
23
the strength of opponent. So I first use a Data Table on the advanced statistics index (from `Demo B`) to
24
-
list last year's opponents' strength. Then I use `VLOOKUP` on the teams actually faced (from `Demo C`) to check
24
+
list last year's opponents' strength. Then I use [`VLOOKUP`](https://support.google.com/docs/answer/3093318?hl=en) on the teams actually faced (from `Demo C`) to check
25
25
the 2 data sources match (they don't for a couple of teams, so I fix that). This allows me to build a lookup table
26
26
for the offensive and defensive strength of each opponent.
* Now I edit the Aggregation Table from `Part 1` to add the lookup table, and then change the Map/Reduce job to incorporate it.
29
+
*[Demo E](Demos.md#demo-e)
30
+
* A common Spreadsheet construct is the [pivot table](https://en.wikipedia.org/wiki/Pivot_table). In this demo I create a composite aggregation with 2 bucket fields then show how easy it is to build a 2d pivot table from that aggregation, using the [built-in Sheets functionality](https://support.google.com/docs/answer/1272900?co=GENIE.Platform%3DDesktop&hl=en&oco=1).
31
+
*[Demo F](Demos.md#demo-f)
31
32
* In this simple demo, I add a pagination feature to the table from `Demo D` so that I can scroll through the data.
32
33
33
34
# Demo A
@@ -47,28 +48,28 @@ I use the custom function `buildEsSubTable` to turn one the nested arrays into a
47
48
48
49
# Demo C
49
50
50
-
_The first index contains lineup statistics from basketball games. I use SQL to generate some simple
51
+
_The first index contains lineup statistics from basketball games. I use [SQL](https://www.elastic.co/products/stack/elasticsearch-sql) to generate some simple
51
52
aggregations grouped by the lineup. I want to filter the statistics to be over only a certain class of opponent,
52
53
but that's ~30 teams so cumbersome to type by hand. So I build another `GROUP BY` SQL table just listing the teams,
53
-
use an adjacent column to specify the opponent class, turn that into a SQL query with Google Sheets' `CONCATENATE`
54
-
, `TEXTJOIN`, and `FILTER` functions, and then inject that query into the Table._
54
+
use an adjacent column to specify the opponent class, turn that into a SQL query with [Google Sheets' `CONCATENATE`
55
+
, `TEXTJOIN`, and `FILTER` functions](https://support.google.com/docs/table/25273?hl=en&ref_topic=9054531), and then inject that query into the Table._
_I duplicate `Demo C` but using a combination of standard Elasticsearch aggregations (`terms` grouping, `sum` metric)
63
-
and Map/Reduce (a UI over the top of `scripted_metric`)_
63
+
_I duplicate `Demo C` but using a combination of standard [Elasticsearch aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html) (`terms` grouping, `sum` metric)
64
+
and Map/Reduce (a UI over the top of `scripted_metric`)._
_The reason for using a more complex Map/Reduce in `Part 1` was to be able to adjust the statistics based on
70
71
the strength of opponent. So I first use a Data Table on the advanced statistics index (from `Demo B`) to
71
-
list last year's opponents' strength. Then I use `VLOOKUP` on the teams actually faced (from `Demo C`) to check
72
+
list last year's opponents' strength. Then I use [`VLOOKUP`](https://support.google.com/docs/answer/3093318?hl=en) on the teams actually faced (from `Demo C`) to check
72
73
the 2 data sources match (they don't for a couple of teams, so I fix that). This allows me to build a lookup table
73
74
for the offensive and defensive strength of each opponent._
74
75
@@ -77,12 +78,18 @@ _The reason for using a more complex Map/Reduce in `Part 1` was to be able to ad
77
78
## Part 3
78
79
79
80
_Now I edit the Aggregation Table from `Part 1` to add the lookup table, and then change the Map/Reduce job to
_A common Spreadsheet construct is the [pivot table](https://en.wikipedia.org/wiki/Pivot_table). In this demo I create a composite aggregation with 2 bucket fields then show how easy it is to build a 2d pivot table from that aggregation, using the [built-in Sheets functionality](https://support.google.com/docs/answer/1272900?co=GENIE.Platform%3DDesktop&hl=en&oco=1)._
0 commit comments