Skip to content

Commit 6cb1036

Browse files
committed
[#41] Fixes #41 added Pivot table demo gif
1 parent a1644c5 commit 6cb1036

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

Demos.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
This page contains some gifs demonstrating some of the key features of the tool.
22

3-
* [Demo A](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#demo-a)
3+
* [Demo A](Demos.md#demo-a)
44
* I create a Data Table for one of my indices and discover it has hundreds of columns. I use the `Data Explorer`
55
Map/Reduce template to build a summary of the data and then the Google Sheets filter to filter out boring fields.
66
Finally I paste the filtered column into the Table's `Fields` selector and refresh, to make the table useful.
7-
* [Demo B](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#demo-b)
7+
* [Demo B](Demos.md#demo-b)
88
* I create a Data Table for a different index, and notice it has medium-sized arrays of (~30) complex objects.
99
I use the custom function `buildEsSubTable` to turn one of the nested arrays into a table of its own.
10-
* [Demo C](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#demo-c)
11-
* 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
1212
aggregations grouped by the lineup. I want to filter the statistics to be over only a certain class of opponent,
1313
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.
16-
* [Demo D](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#demo-d)
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](https://support.google.com/docs/table/25273?hl=en&ref_topic=9054531), and then inject that query into the Table.
16+
* [Demo D](Demos.md#demo-d)
1717
* There's a lot happening here, so I've split it into 3 parts:
18-
* [Part 1](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#part-1)
19-
* 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)
2020
and Map/Reduce (a UI over the top of `scripted_metric`)
21-
* [Part 2](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#part-2)
21+
* [Part 2](Demos.md#part-2)
2222
* The reason for using a more complex Map/Reduce in `Part 1` was to be able to adjust the statistics based on
2323
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
2525
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
2626
for the offensive and defensive strength of each opponent.
27-
* [Part 3](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#part-3)
28-
* Now I edit the Aggregation Table from `Part 1` to add the lookup table, and then change the Map/Reduce job to
29-
incorporate it
30-
* [Demo E](https://github.com/Alex-At-Home/elasticsearch-sheets/blob/master/Demos.md#demo-e)
27+
* [Part 3](Demos.md#part-3)
28+
* 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)
3132
* In this simple demo, I add a pagination feature to the table from `Demo D` so that I can scroll through the data.
3233

3334
# Demo A
@@ -47,28 +48,28 @@ I use the custom function `buildEsSubTable` to turn one the nested arrays into a
4748

4849
# Demo C
4950

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
5152
aggregations grouped by the lineup. I want to filter the statistics to be over only a certain class of opponent,
5253
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._
5556

5657
![elastic-sheets-demo-C](https://user-images.githubusercontent.com/17573856/55519972-29c63380-5648-11e9-997f-110075eb31ce.gif)
5758

5859
# Demo D
5960

6061
## Part 1
6162

62-
_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`)._
6465

6566
![elastic-sheets-demo-Da](https://user-images.githubusercontent.com/17573856/55519979-2f237e00-5648-11e9-91df-9210eb8533c3.gif)
6667

6768
## Part 2
6869

6970
_The reason for using a more complex Map/Reduce in `Part 1` was to be able to adjust the statistics based on
7071
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
7273
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
7374
for the offensive and defensive strength of each opponent._
7475

@@ -77,12 +78,18 @@ _The reason for using a more complex Map/Reduce in `Part 1` was to be able to ad
7778
## Part 3
7879

7980
_Now I edit the Aggregation Table from `Part 1` to add the lookup table, and then change the Map/Reduce job to
80-
incorportate it_
81+
incorporate it._
8182

8283
![elastic-sheets-demo-Dc](https://user-images.githubusercontent.com/17573856/55519990-38ace600-5648-11e9-9185-466d1baf872f.gif)
8384

8485
# Demo E
8586

87+
_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)._
88+
89+
![elastic-sheets-demo-E](https://user-images.githubusercontent.com/19776583/56977981-77996300-6b44-11e9-88d9-d876dbd0d85a.gif)
90+
91+
# Demo F
92+
8693
_In this simple demo, I add a pagination feature to the table from `Demo D` so that I can scroll through the data._
8794

88-
![elastic-sheets-demo-E](https://user-images.githubusercontent.com/17573856/55519995-3d719a00-5648-11e9-8410-d6b0e97ae993.gif)
95+
![elastic-sheets-demo-F](https://user-images.githubusercontent.com/17573856/55519995-3d719a00-5648-11e9-8410-d6b0e97ae993.gif)

0 commit comments

Comments
 (0)