Professional Documents
Culture Documents
The goal of this workbook is help you use your Excel knowledge as a foundation for learning SQL.
For more context on why you might want to transition your workflow from Excel to SQL, check out
this companion blog post: https://blog.modeanalytics.com/learn-sql-using-excel/
Each worksheet contains an example of manipulated data, a detailed explanation of the function(s)
behind it, and how Excel and SQL are used to approach it. This workbook is not a complete tutorial
by any means. Rather, it's meant to highlight SQL and Excel's relative strengths, suggest cases where
it's appropriate to use one over the other, and direct you to the appropriate resources to execute
these tasks on your own.
The worksheets build upon one another, so they should be viewed from left to right. Here's a quick
table of contents:
1. Arithmetic
2. IF
3. Filtering
4. VLOOKUP (two parts)
5. SUM-COUNT-AVG
6. Grouped Aggregation
Many of the lessons here link to the result in Mode. It's a collaborative analytics platform used by
companies and individuals to analyze data and share their results. The datasets in this file are pre-
loaded into Mode and example SQL code is linked from each tab in this workbook. You can look at
the examples without signing in, but if you create an account, you'll be able to test out some SQL
yourself using this dataset. You can create a Mode account here: http://about.modeanalytics.com
The lessons also link to Mode's SQL School, which is a plain-English guide to SQL and basic database
concepts. If you are completely new to SQL, you might want to check out the first few lessons
starting here: https://sqlschool.modeanalytics.com/the-basics/introduction/
tion for learning SQL.
xcel to SQL, check out
xcel/
each cell is treated as its own entity —it's not necessarily tied
r cells, but when you open a new worksheet, each cell stands
y cell in the 'margin' column with a value in it. I2 references
st as easily reference information anywhere in this
his is true of any cell.
ghtforward:
orts/12b52e961f5f/queries/4525b41bfd56
at as:
ome condition is met> THEN <display this value> ELSE <display a different
SQL queries aren't restricted to single line. That makes it easy to nest many
mn. Doing so would look like this:
e top, you will see that the output matches this Excel worksheet.
xible when it comes to filtering. You can't apply filters to just any
ork when applied to a row of column headers, and they work best
aders at once.
c column, click the arrow next to that column name. You can
s from the list or by selecting options (equal to, less than, greater
menu.
ets is very simple—you simply specify the column name you want
statement using the WHERE claus:
y here:
orial/reports/2fe491777da0/queries/911320160429
e top will show the output. As an exercise, try making this output
e filters in this worksheet. Side note: check out what happens to
e filters.
food sales data. Skip to the next worksheet to see how this is executed in Excel
taset shows grocery information, the same patterns exist elsewhere. For
zon Prime users and we could be joining it onto a list of all transactions made
transaction_id time product_id product_name product_type price/unit
1 2016-01-08T17: 3 orange produce 1.02
1 2016-01-08T17: 61 grapefruits produce 0.55
2 2016-01-07T14: 23 pine_nuts dry_goods 0.91
4 2016-01-06T17: 52 cranberry_infus dairy 1.79
4 2016-01-06T17: 4 clementines produce 1.19
4 2016-01-06T17: 76 cheddar_whales snacks 0.69
5 2016-01-07T14: 45 butter_chicken frozen 1.29
7 2016-01-07T12: 17 bottled_organic_other 2.67
7 2016-01-07T12: 31 almond_nut_thinsnacks 0.61
7 2016-01-07T12: 21 buttermilk_pancsnacks 2.59
7 2016-01-07T12: 47 paneer dairy 1.17
7 2016-01-07T12: 44 frozen_clams frozen 4.99
8 2016-01-07T09: 8 pluot produce 3.99
8 2016-01-07T09: 60 satsuma_orangeproduce 2.06
8 2016-01-07T09: 38 pork_gyoza frozen 1.19
8 2016-01-07T09: 64 white_onions produce 1.22
9 2016-01-03T09: 12 vegan_egg_substdairy 1.15
9 2016-01-03T09: 14 falafel_chips snacks 0.53
9 2016-01-03T09: 17 bottled_organic_other 2.67
9 2016-01-03T09: 70 orzo dry_goods 0.19
9 2016-01-03T09: 10 pomello produce 0.96
10 2016-01-04T08: 18 chia_seeds dry_goods 0.67
11 2016-01-08T11: 77 sugar_snap_peasproduce 2.67
11 2016-01-08T11: 25 smoked_salmon meat 39.99
11 2016-01-08T11: 47 paneer dairy 1.17
11 2016-01-08T11: 36 olive_tapanade canned_jarred_ 1.12
11 2016-01-08T11: 10 pomello produce 0.96
12 2016-01-04T17: 66 yellow_onions produce 1.12
13 2016-01-04T13: 21 buttermilk_pancsnacks 2.59
15 2016-01-05T09: 42 porchini_mushr produce 5.99
15 2016-01-05T09: 56 organic_glazed_ dry_goods 0.86
15 2016-01-05T09: 29 asiago_cheese dairy 0.63
16 2016-01-05T14: 36 olive_tapanade canned_jarred_ 1.12
16 2016-01-05T14: 41 frozen_tamales frozen 1.09
16 2016-01-05T14: 22 smoked_trout meat 19.59
17 2016-01-07T18: 73 cheddar_corn_stsnacks 0.69
17 2016-01-07T18: 41 frozen_tamales frozen 1.09
19 2016-01-04T12: 76 cheddar_whales snacks 0.69
19 2016-01-04T12: 71 autumn_pilaf dry_goods 0.24
20 2016-01-04T10: 6 blood_lime produce 1.69
20 2016-01-04T10: 6 blood_lime produce 1.69
20 2016-01-04T10: 29 asiago_cheese dairy 0.63
20 2016-01-04T10: 10 pomello produce 0.96
21 2016-01-05T09: 47 paneer dairy 1.17
21 2016-01-05T09: 68 salmonberries produce 0.67
21 2016-01-05T09: 52 cranberry_infus dairy 1.79
21 2016-01-05T09: 41 frozen_tamales frozen 1.09
22 2016-01-06T14: 14 falafel_chips snacks 0.53
22 2016-01-06T14: 27 celery_foam other 6
23 2016-01-07T09: 67 barberries dry_goods 1.74
23 2016-01-07T09: 13 asparagus_waterbeverages 0.38
23 2016-01-07T09: 55 parmigiano_reggdairy 1.1
23 2016-01-07T09: 69 wholewheat_coudry_goods 0.27
24 2016-01-03T10: 54 aged_gouda dairy 1.23
24 2016-01-03T10: 3 orange produce 1.02
25 2016-01-06T19: 83 soy_ginger_trail snacks 0.39
26 2016-01-06T08: 26 green_juice beverages 0.25
26 2016-01-06T08: 22 smoked_trout meat 19.59
26 2016-01-06T08: 5 blood_orange produce 3.86
26 2016-01-06T08: 32 arugula produce 2.99
26 2016-01-06T08: 47 paneer dairy 1.17
27 2016-01-07T17: 51 english_cheddardairy 0.89
27 2016-01-07T17: 40 vegetable_gyozafrozen 1.17
27 2016-01-07T17: 48 organic_mung_bdry_goods 0.89
29 2016-01-07T12: 28 protein_powder dry_goods 0.69
30 2016-01-05T13: 68 salmonberries produce 0.67
31 2016-01-05T13: 3 orange produce 1.02
32 2016-01-04T19: 65 purple_onions produce 1.32
32 2016-01-04T19: 7 tayberry produce 2.54
32 2016-01-04T19: 67 barberries dry_goods 1.74
32 2016-01-04T19: 7 tayberry produce 2.54
32 2016-01-04T19: 3 orange produce 1.02
33 2016-01-03T11: 72 wild_rice dry_goods 0.27
34 2016-01-08T12: 84 buckwheat_flourdry_goods 2.59
35 2016-01-05T16: 65 purple_onions produce 1.32
35 2016-01-05T16: 14 falafel_chips snacks 0.53
35 2016-01-05T16: 44 frozen_clams frozen 4.99
36 2016-01-07T16: 59 medjool_dates produce 4.29
36 2016-01-07T16: 63 organic_garlic produce 3.57
37 2016-01-06T15: 52 cranberry_infus dairy 1.79
37 2016-01-06T15: 19 all_natural_cheesnacks 0.41
37 2016-01-06T15: 8 pluot produce 3.99
38 2016-01-06T13: 69 wholewheat_coudry_goods 0.27
39 2016-01-08T16: 66 yellow_onions produce 1.12
39 2016-01-08T16: 24 dried_apricots dry_goods 0.56
40 2016-01-03T10: 7 tayberry produce 2.54
40 2016-01-03T10: 1 strawberry produce 3.28
40 2016-01-03T10: 17 bottled_organic_other 2.67
41 2016-01-05T14: 52 cranberry_infus dairy 1.79
41 2016-01-05T14: 61 grapefruits produce 0.55
41 2016-01-05T14: 62 goji_berries dry_goods 1.17
42 2016-01-05T11: 77 sugar_snap_peasproduce 2.67
43 2016-01-03T19: 2 apple_fuji produce 1.44
43 2016-01-03T19: 41 frozen_tamales frozen 1.09
44 2016-01-06T17: 56 organic_glazed_ dry_goods 0.86
44 2016-01-06T17: 75 rice_crackers snacks 0.57
45 2016-01-07T08: 75 rice_crackers snacks 0.57
45 2016-01-07T08: 40 vegetable_gyozafrozen 1.17
45 2016-01-07T08: 39 table_wafers snacks 0.59
45 2016-01-07T08: 51 english_cheddardairy 0.89
45 2016-01-07T08: 52 cranberry_infus dairy 1.79
46 2016-01-03T09: 63 organic_garlic produce 3.57
46 2016-01-03T09: 43 garlic_naan bread 0.99
47 2016-01-07T17: 28 protein_powder dry_goods 0.69
48 2016-01-08T15: 30 camembert_cheedairy 0.91
48 2016-01-08T15: 23 pine_nuts dry_goods 0.91
48 2016-01-08T15: 18 chia_seeds dry_goods 0.67
48 2016-01-08T15: 20 sriracha_popcor snacks 1.11
49 2016-01-07T17: 67 barberries dry_goods 1.74
49 2016-01-07T17: 53 black_pepper_godairy 1.69
50 2016-01-06T14: 56 organic_glazed_ dry_goods 0.86
50 2016-01-06T14: 80 rooibos_tea dry_goods 3.49
52 2016-01-05T15: 50 white_cheddar dairy 0.77
52 2016-01-05T15: 13 asparagus_waterbeverages 0.38
52 2016-01-05T15: 44 frozen_clams frozen 4.99
53 2016-01-06T11: 61 grapefruits produce 0.55
53 2016-01-06T11: 33 white_bean_andcanned_jarred_ 0.97
53 2016-01-06T11: 36 olive_tapanade canned_jarred_ 1.12
53 2016-01-06T11: 29 asiago_cheese dairy 0.63
54 2016-01-03T08: 20 sriracha_popcor snacks 1.11
54 2016-01-03T08: 79 darjeeling_black dry_goods 3.3
55 2016-01-05T19: 8 pluot produce 3.99
55 2016-01-05T19: 76 cheddar_whales snacks 0.69
56 2016-01-03T12: 62 goji_berries dry_goods 1.17
56 2016-01-03T12: 70 orzo dry_goods 0.19
57 2016-01-07T19: 81 irish_breakfast_ dry_goods 2.99
57 2016-01-07T19: 64 white_onions produce 1.22
57 2016-01-07T19: 11 pineberry produce 4.89
58 2016-01-08T09: 79 darjeeling_black dry_goods 3.3
58 2016-01-08T09: 37 chocolate_ganacfrozen 3.52
58 2016-01-08T09: 39 table_wafers snacks 0.59
58 2016-01-08T09: 27 celery_foam other 6
59 2016-01-08T14: 4 clementines produce 1.19
60 2016-01-03T13: 51 english_cheddardairy 0.89
60 2016-01-03T13: 13 asparagus_waterbeverages 0.38
60 2016-01-03T13: 78 garam_masala dry_goods 1.44
61 2016-01-03T09: 22 smoked_trout meat 19.59
61 2016-01-03T09: 31 almond_nut_thinsnacks 0.61
61 2016-01-03T09: 46 frozen_salmon frozen 16.99
61 2016-01-03T09: 46 frozen_salmon frozen 16.99
62 2016-01-07T14: 56 organic_glazed_ dry_goods 0.86
63 2016-01-06T18: 16 arugula_crisps snacks 2.43
64 2016-01-06T18: 16 arugula_crisps snacks 2.43
64 2016-01-06T18: 70 orzo dry_goods 0.19
64 2016-01-06T18: 22 smoked_trout meat 19.59
65 2016-01-07T16: 50 white_cheddar dairy 0.77
65 2016-01-07T16: 29 asiago_cheese dairy 0.63
65 2016-01-07T16: 58 pumpkin_spice_ dry_goods 0.96
66 2016-01-08T16: 39 table_wafers snacks 0.59
67 2016-01-04T19: 55 parmigiano_reggdairy 1.1
67 2016-01-04T19: 49 silken_tofu dairy 0.67
67 2016-01-04T19: 67 barberries dry_goods 1.74
68 2016-01-03T19: 36 olive_tapanade canned_jarred_ 1.12
69 2016-01-05T09: 82 mango_black_tedry_goods 3.08
69 2016-01-05T09: 55 parmigiano_reggdairy 1.1
69 2016-01-05T09: 60 satsuma_orangeproduce 2.06
69 2016-01-05T09: 62 goji_berries dry_goods 1.17
70 2016-01-06T11: 21 buttermilk_pancsnacks 2.59
70 2016-01-06T11: 81 irish_breakfast_ dry_goods 2.99
70 2016-01-06T11: 56 organic_glazed_ dry_goods 0.86
71 2016-01-04T11: 74 poppy_onion_sessnacks 0.75
72 2016-01-06T19: 30 camembert_cheedairy 0.91
72 2016-01-06T19: 19 all_natural_cheesnacks 0.41
72 2016-01-06T19: 67 barberries dry_goods 1.74
72 2016-01-06T19: 42 porchini_mushr produce 5.99
73 2016-01-07T11: 81 irish_breakfast_ dry_goods 2.99
73 2016-01-07T11: 24 dried_apricots dry_goods 0.56
73 2016-01-07T11: 20 sriracha_popcor snacks 1.11
74 2016-01-07T19: 21 buttermilk_pancsnacks 2.59
74 2016-01-07T19: 36 olive_tapanade canned_jarred_ 1.12
75 2016-01-04T13: 11 pineberry produce 4.89
75 2016-01-04T13: 72 wild_rice dry_goods 0.27
76 2016-01-06T12: 57 Kumatos produce 3.6
76 2016-01-06T12: 73 cheddar_corn_stsnacks 0.69
77 2016-01-06T14: 28 protein_powder dry_goods 0.69
78 2016-01-06T09: 76 cheddar_whales snacks 0.69
78 2016-01-06T09: 25 smoked_salmon meat 39.99
78 2016-01-06T09: 2 apple_fuji produce 1.44
78 2016-01-06T09: 12 vegan_egg_substdairy 1.15
79 2016-01-05T19: 9 tangelo produce 0.96
79 2016-01-05T19: 10 pomello produce 0.96
79 2016-01-05T19: 16 arugula_crisps snacks 2.43
81 2016-01-03T09: 65 purple_onions produce 1.32
82 2016-01-04T18: 17 bottled_organic_other 2.67
82 2016-01-04T18: 20 sriracha_popcor snacks 1.11
82 2016-01-04T18: 14 falafel_chips snacks 0.53
82 2016-01-04T18: 27 celery_foam other 6
83 2016-01-08T12: 60 satsuma_orangeproduce 2.06
84 2016-01-08T19: 67 barberries dry_goods 1.74
84 2016-01-08T19: 77 sugar_snap_peasproduce 2.67
85 2016-01-07T12: 79 darjeeling_black dry_goods 3.3
85 2016-01-07T12: 81 irish_breakfast_ dry_goods 2.99
86 2016-01-07T09: 9 tangelo produce 0.96
86 2016-01-07T09: 42 porchini_mushr produce 5.99
86 2016-01-07T09: 69 wholewheat_coudry_goods 0.27
86 2016-01-07T09: 76 cheddar_whales snacks 0.69
87 2016-01-05T11: 63 organic_garlic produce 3.57
87 2016-01-05T11: 78 garam_masala dry_goods 1.44
88 2016-01-04T16: 82 mango_black_tedry_goods 3.08
88 2016-01-04T16: 69 wholewheat_coudry_goods 0.27
88 2016-01-04T16: 81 irish_breakfast_ dry_goods 2.99
88 2016-01-04T16: 78 garam_masala dry_goods 1.44
88 2016-01-04T16: 80 rooibos_tea dry_goods 3.49
89 2016-01-06T17: 58 pumpkin_spice_ dry_goods 0.96
90 2016-01-05T08: 57 Kumatos produce 3.6
90 2016-01-05T08: 19 all_natural_cheesnacks 0.41
91 2016-01-07T12: 26 green_juice beverages 0.25
91 2016-01-07T12: 13 asparagus_waterbeverages 0.38
91 2016-01-07T12: 2 apple_fuji produce 1.44
91 2016-01-07T12: 35 eggplant_caponafrozen 1.39
92 2016-01-08T12: 6 blood_lime produce 1.69
93 2016-01-04T17: 23 pine_nuts dry_goods 0.91
93 2016-01-04T17: 46 frozen_salmon frozen 16.99
93 2016-01-04T17: 21 buttermilk_pancsnacks 2.59
94 2016-01-04T10: 11 pineberry produce 4.89
94 2016-01-04T10: 64 white_onions produce 1.22
95 2016-01-08T14: 15 sweet_potato_h snacks 0.43
96 2016-01-04T16: 76 cheddar_whales snacks 0.69
97 2016-01-08T12: 7 tayberry produce 2.54
97 2016-01-08T12: 40 vegetable_gyozafrozen 1.17
97 2016-01-08T12: 38 pork_gyoza frozen 1.19
97 2016-01-08T12: 36 olive_tapanade canned_jarred_ 1.12
98 2016-01-04T19: 75 rice_crackers snacks 0.57
98 2016-01-04T19: 35 eggplant_caponafrozen 1.39
99 2016-01-06T19: 15 sweet_potato_h snacks 0.43
99 2016-01-06T19: 40 vegetable_gyozafrozen 1.17
100 2016-01-05T16: 78 garam_masala dry_goods 1.44
100 2016-01-05T16: 2 apple_fuji produce 1.44
100 2016-01-05T16: 64 white_onions produce 1.22
100 2016-01-05T16: 13 asparagus_waterbeverages 0.38
101 2016-01-04T19: 78 garam_masala dry_goods 1.44
101 2016-01-04T19: 48 organic_mung_bdry_goods 0.89
101 2016-01-04T19: 17 bottled_organic_other 2.67
101 2016-01-04T19: 15 sweet_potato_h snacks 0.43
102 2016-01-04T18: 48 organic_mung_bdry_goods 0.89
102 2016-01-04T18: 39 table_wafers snacks 0.59
102 2016-01-04T18: 35 eggplant_caponafrozen 1.39
103 2016-01-05T17: 57 Kumatos produce 3.6
103 2016-01-05T17: 72 wild_rice dry_goods 0.27
103 2016-01-05T17: 51 english_cheddardairy 0.89
104 2016-01-08T08: 75 rice_crackers snacks 0.57
104 2016-01-08T08: 42 porchini_mushr produce 5.99
104 2016-01-08T08: 17 bottled_organic_other 2.67
105 2016-01-08T10: 81 irish_breakfast_ dry_goods 2.99
105 2016-01-08T10: 24 dried_apricots dry_goods 0.56
105 2016-01-08T10: 57 Kumatos produce 3.6
106 2016-01-03T09: 57 Kumatos produce 3.6
106 2016-01-03T09: 46 frozen_salmon frozen 16.99
106 2016-01-03T09: 38 pork_gyoza frozen 1.19
106 2016-01-03T09: 36 olive_tapanade canned_jarred_ 1.12
106 2016-01-03T09: 34 edamame_hummcanned_jarred_ 0.95
106 2016-01-03T09: 60 satsuma_orangeproduce 2.06
107 2016-01-08T17: 12 vegan_egg_substdairy 1.15
108 2016-01-04T12: 5 blood_orange produce 3.86
108 2016-01-04T12: 27 celery_foam other 6
108 2016-01-04T12: 25 smoked_salmon meat 39.99
109 2016-01-06T11: 78 garam_masala dry_goods 1.44
109 2016-01-06T11: 37 chocolate_ganacfrozen 3.52
109 2016-01-06T11: 59 medjool_dates produce 4.29
110 2016-01-08T10: 70 orzo dry_goods 0.19
111 2016-01-05T19: 46 frozen_salmon frozen 16.99
112 2016-01-07T10: 11 pineberry produce 4.89
112 2016-01-07T10: 72 wild_rice dry_goods 0.27
113 2016-01-08T14: 65 purple_onions produce 1.32
113 2016-01-08T14: 27 celery_foam other 6
114 2016-01-05T11: 77 sugar_snap_peasproduce 2.67
114 2016-01-05T11: 13 asparagus_waterbeverages 0.38
116 2016-01-05T11: 11 pineberry produce 4.89
116 2016-01-05T11: 37 chocolate_ganacfrozen 3.52
117 2016-01-05T13: 9 tangelo produce 0.96
118 2016-01-06T14: 23 pine_nuts dry_goods 0.91
118 2016-01-06T14: 40 vegetable_gyozafrozen 1.17
118 2016-01-06T14: 75 rice_crackers snacks 0.57
118 2016-01-06T14: 8 pluot produce 3.99
118 2016-01-06T14: 18 chia_seeds dry_goods 0.67
118 2016-01-06T14: 48 organic_mung_bdry_goods 0.89
119 2016-01-03T15: 76 cheddar_whales snacks 0.69
120 2016-01-03T14: 53 black_pepper_godairy 1.69
120 2016-01-03T14: 63 organic_garlic produce 3.57
120 2016-01-03T14: 7 tayberry produce 2.54
121 2016-01-08T14: 32 arugula produce 2.99
121 2016-01-08T14: 20 sriracha_popcor snacks 1.11
121 2016-01-08T14: 63 organic_garlic produce 3.57
121 2016-01-08T14: 27 celery_foam other 6
123 2016-01-08T10: 49 silken_tofu dairy 0.67
123 2016-01-08T10: 58 pumpkin_spice_ dry_goods 0.96
123 2016-01-08T10: 19 all_natural_cheesnacks 0.41
124 2016-01-03T08: 83 soy_ginger_trail snacks 0.39
124 2016-01-03T08: 44 frozen_clams frozen 4.99
126 2016-01-03T12: 4 clementines produce 1.19
127 2016-01-04T09: 40 vegetable_gyozafrozen 1.17
127 2016-01-04T09: 5 blood_orange produce 3.86
128 2016-01-03T15: 36 olive_tapanade canned_jarred_ 1.12
128 2016-01-03T15: 15 sweet_potato_h snacks 0.43
129 2016-01-06T19: 21 buttermilk_pancsnacks 2.59
129 2016-01-06T19: 55 parmigiano_reggdairy 1.1
130 2016-01-06T16: 71 autumn_pilaf dry_goods 0.24
130 2016-01-06T16: 55 parmigiano_reggdairy 1.1
131 2016-01-06T19: 4 clementines produce 1.19
133 2016-01-07T18: 59 medjool_dates produce 4.29
133 2016-01-07T18: 72 wild_rice dry_goods 0.27
134 2016-01-04T17: 33 white_bean_andcanned_jarred_ 0.97
134 2016-01-04T17: 49 silken_tofu dairy 0.67
134 2016-01-04T17: 69 wholewheat_coudry_goods 0.27
135 2016-01-03T15: 15 sweet_potato_h snacks 0.43
135 2016-01-03T15: 11 pineberry produce 4.89
136 2016-01-06T12: 73 cheddar_corn_stsnacks 0.69
136 2016-01-06T12: 27 celery_foam other 6
136 2016-01-06T12: 10 pomello produce 0.96
137 2016-01-03T14: 39 table_wafers snacks 0.59
137 2016-01-03T14: 84 buckwheat_flourdry_goods 2.59
138 2016-01-08T17: 13 asparagus_waterbeverages 0.38
138 2016-01-08T17: 55 parmigiano_reggdairy 1.1
138 2016-01-08T17: 40 vegetable_gyozafrozen 1.17
138 2016-01-08T17: 5 blood_orange produce 3.86
139 2016-01-03T19: 54 aged_gouda dairy 1.23
139 2016-01-03T19: 69 wholewheat_coudry_goods 0.27
139 2016-01-03T19: 2 apple_fuji produce 1.44
139 2016-01-03T19: 31 almond_nut_thinsnacks 0.61
142 2016-01-06T14: 73 cheddar_corn_stsnacks 0.69
142 2016-01-06T14: 31 almond_nut_thinsnacks 0.61
142 2016-01-06T14: 24 dried_apricots dry_goods 0.56
143 2016-01-06T08: 73 cheddar_corn_stsnacks 0.69
143 2016-01-06T08: 77 sugar_snap_peasproduce 2.67
143 2016-01-06T08: 84 buckwheat_flourdry_goods 2.59
144 2016-01-05T19: 46 frozen_salmon frozen 16.99
145 2016-01-05T13: 52 cranberry_infus dairy 1.79
145 2016-01-05T13: 79 darjeeling_black dry_goods 3.3
146 2016-01-03T13: 31 almond_nut_thinsnacks 0.61
147 2016-01-08T17: 52 cranberry_infus dairy 1.79
147 2016-01-08T17: 39 table_wafers snacks 0.59
147 2016-01-08T17: 58 pumpkin_spice_ dry_goods 0.96
148 2016-01-03T18: 15 sweet_potato_h snacks 0.43
149 2016-01-08T15: 71 autumn_pilaf dry_goods 0.24
149 2016-01-08T15: 54 aged_gouda dairy 1.23
151 2016-01-06T17: 9 tangelo produce 0.96
151 2016-01-06T17: 12 vegan_egg_substdairy 1.15
151 2016-01-06T17: 13 asparagus_waterbeverages 0.38
152 2016-01-03T12: 84 buckwheat_flourdry_goods 2.59
152 2016-01-03T12: 65 purple_onions produce 1.32
153 2016-01-06T08: 1 strawberry produce 3.28
153 2016-01-06T08: 56 organic_glazed_ dry_goods 0.86
154 2016-01-06T14: 54 aged_gouda dairy 1.23
154 2016-01-06T14: 64 white_onions produce 1.22
155 2016-01-07T18: 12 vegan_egg_substdairy 1.15
155 2016-01-07T18: 69 wholewheat_coudry_goods 0.27
156 2016-01-06T19: 37 chocolate_ganacfrozen 3.52
157 2016-01-04T14: 8 pluot produce 3.99
157 2016-01-04T14: 8 pluot produce 3.99
157 2016-01-04T14: 61 grapefruits produce 0.55
158 2016-01-08T12: 9 tangelo produce 0.96
158 2016-01-08T12: 29 asiago_cheese dairy 0.63
158 2016-01-08T12: 72 wild_rice dry_goods 0.27
158 2016-01-08T12: 54 aged_gouda dairy 1.23
158 2016-01-08T12: 47 paneer dairy 1.17
159 2016-01-04T12: 77 sugar_snap_peasproduce 2.67
159 2016-01-04T12: 25 smoked_salmon meat 39.99
159 2016-01-04T12: 78 garam_masala dry_goods 1.44
160 2016-01-04T19: 1 strawberry produce 3.28
160 2016-01-04T19: 13 asparagus_waterbeverages 0.38
160 2016-01-04T19: 32 arugula produce 2.99
161 2016-01-03T14: 40 vegetable_gyozafrozen 1.17
162 2016-01-05T13: 55 parmigiano_reggdairy 1.1
162 2016-01-05T13: 61 grapefruits produce 0.55
163 2016-01-03T10: 3 orange produce 1.02
163 2016-01-03T10: 6 blood_lime produce 1.69
163 2016-01-03T10: 62 goji_berries dry_goods 1.17
163 2016-01-03T10: 26 green_juice beverages 0.25
163 2016-01-03T10: 51 english_cheddardairy 0.89
163 2016-01-03T10: 60 satsuma_orangeproduce 2.06
164 2016-01-06T19: 2 apple_fuji produce 1.44
164 2016-01-06T19: 31 almond_nut_thinsnacks 0.61
164 2016-01-06T19: 58 pumpkin_spice_ dry_goods 0.96
165 2016-01-03T19: 28 protein_powder dry_goods 0.69
165 2016-01-03T19: 57 Kumatos produce 3.6
166 2016-01-04T18: 63 organic_garlic produce 3.57
166 2016-01-04T18: 70 orzo dry_goods 0.19
167 2016-01-05T16: 79 darjeeling_black dry_goods 3.3
168 2016-01-06T17: 39 table_wafers snacks 0.59
168 2016-01-06T17: 65 purple_onions produce 1.32
169 2016-01-06T08: 37 chocolate_ganacfrozen 3.52
169 2016-01-06T08: 44 frozen_clams frozen 4.99
170 2016-01-04T16: 2 apple_fuji produce 1.44
170 2016-01-04T16: 74 poppy_onion_sessnacks 0.75
170 2016-01-04T16: 9 tangelo produce 0.96
171 2016-01-08T17: 78 garam_masala dry_goods 1.44
171 2016-01-08T17: 43 garlic_naan bread 0.99
171 2016-01-08T17: 18 chia_seeds dry_goods 0.67
172 2016-01-08T08: 46 frozen_salmon frozen 16.99
172 2016-01-08T08: 82 mango_black_tedry_goods 3.08
173 2016-01-05T08: 42 porchini_mushr produce 5.99
173 2016-01-05T08: 59 medjool_dates produce 4.29
173 2016-01-05T08: 71 autumn_pilaf dry_goods 0.24
174 2016-01-04T18: 56 organic_glazed_ dry_goods 0.86
174 2016-01-04T18: 49 silken_tofu dairy 0.67
174 2016-01-04T18: 30 camembert_cheedairy 0.91
175 2016-01-03T11: 15 sweet_potato_h snacks 0.43
175 2016-01-03T11: 48 organic_mung_bdry_goods 0.89
175 2016-01-03T11: 79 darjeeling_black dry_goods 3.3
176 2016-01-06T16: 71 autumn_pilaf dry_goods 0.24
176 2016-01-06T16: 53 black_pepper_godairy 1.69
176 2016-01-06T16: 63 organic_garlic produce 3.57
176 2016-01-06T16: 77 sugar_snap_peasproduce 2.67
177 2016-01-03T11: 66 yellow_onions produce 1.12
177 2016-01-03T11: 44 frozen_clams frozen 4.99
177 2016-01-03T11: 43 garlic_naan bread 0.99
178 2016-01-06T13: 39 table_wafers snacks 0.59
178 2016-01-06T13: 51 english_cheddardairy 0.89
179 2016-01-08T12: 22 smoked_trout meat 19.59
179 2016-01-08T12: 36 olive_tapanade canned_jarred_ 1.12
180 2016-01-07T08: 26 green_juice beverages 0.25
182 2016-01-06T12: 36 olive_tapanade canned_jarred_ 1.12
182 2016-01-06T12: 29 asiago_cheese dairy 0.63
182 2016-01-06T12: 6 blood_lime produce 1.69
183 2016-01-05T14: 16 arugula_crisps snacks 2.43
184 2016-01-08T10: 6 blood_lime produce 1.69
185 2016-01-07T11: 11 pineberry produce 4.89
185 2016-01-07T11: 22 smoked_trout meat 19.59
186 2016-01-06T09: 74 poppy_onion_sessnacks 0.75
186 2016-01-06T09: 54 aged_gouda dairy 1.23
187 2016-01-08T11: 16 arugula_crisps snacks 2.43
187 2016-01-08T11: 23 pine_nuts dry_goods 0.91
187 2016-01-08T11: 4 clementines produce 1.19
187 2016-01-08T11: 69 wholewheat_coudry_goods 0.27
188 2016-01-03T17: 12 vegan_egg_substdairy 1.15
190 2016-01-08T08: 27 celery_foam other 6
190 2016-01-08T08: 24 dried_apricots dry_goods 0.56
190 2016-01-08T08: 33 white_bean_andcanned_jarred_ 0.97
190 2016-01-08T08: 77 sugar_snap_peasproduce 2.67
190 2016-01-08T08: 40 vegetable_gyozafrozen 1.17
191 2016-01-08T10: 78 garam_masala dry_goods 1.44
191 2016-01-08T10: 32 arugula produce 2.99
192 2016-01-04T19: 22 smoked_trout meat 19.59
192 2016-01-04T19: 73 cheddar_corn_stsnacks 0.69
193 2016-01-06T11: 62 goji_berries dry_goods 1.17
193 2016-01-06T11: 61 grapefruits produce 0.55
194 2016-01-08T19: 54 aged_gouda dairy 1.23
194 2016-01-08T19: 45 butter_chicken frozen 1.29
194 2016-01-08T19: 31 almond_nut_thinsnacks 0.61
195 2016-01-07T12: 65 purple_onions produce 1.32
195 2016-01-07T12: 32 arugula produce 2.99
195 2016-01-07T12: 34 edamame_hummcanned_jarred_ 0.95
195 2016-01-07T12: 59 medjool_dates produce 4.29
196 2016-01-08T16: 66 yellow_onions produce 1.12
199 2016-01-04T08: 34 edamame_hummcanned_jarred_ 0.95
199 2016-01-04T08: 60 satsuma_orangeproduce 2.06
200 2016-01-08T18: 46 frozen_salmon frozen 16.99
201 2016-01-03T08: 9 tangelo produce 0.96
201 2016-01-03T08: 24 dried_apricots dry_goods 0.56
202 2016-01-07T16: 81 irish_breakfast_ dry_goods 2.99
202 2016-01-07T16: 80 rooibos_tea dry_goods 3.49
202 2016-01-07T16: 43 garlic_naan bread 0.99
203 2016-01-08T11: 67 barberries dry_goods 1.74
203 2016-01-08T11: 60 satsuma_orangeproduce 2.06
203 2016-01-08T11: 14 falafel_chips snacks 0.53
204 2016-01-08T11: 27 celery_foam other 6
204 2016-01-08T11: 41 frozen_tamales frozen 1.09
204 2016-01-08T11: 22 smoked_trout meat 19.59
205 2016-01-07T15: 51 english_cheddardairy 0.89
205 2016-01-07T15: 29 asiago_cheese dairy 0.63
206 2016-01-05T19: 67 barberries dry_goods 1.74
207 2016-01-03T19: 58 pumpkin_spice_ dry_goods 0.96
207 2016-01-03T19: 70 orzo dry_goods 0.19
207 2016-01-03T19: 41 frozen_tamales frozen 1.09
207 2016-01-03T19: 84 buckwheat_flourdry_goods 2.59
209 2016-01-06T19: 14 falafel_chips snacks 0.53
209 2016-01-06T19: 26 green_juice beverages 0.25
209 2016-01-06T19: 36 olive_tapanade canned_jarred_ 1.12
210 2016-01-07T11: 11 pineberry produce 4.89
210 2016-01-07T11: 83 soy_ginger_trail snacks 0.39
210 2016-01-07T11: 82 mango_black_tedry_goods 3.08
211 2016-01-05T13: 45 butter_chicken frozen 1.29
211 2016-01-05T13: 68 salmonberries produce 0.67
211 2016-01-05T13: 23 pine_nuts dry_goods 0.91
212 2016-01-05T11: 60 satsuma_orangeproduce 2.06
213 2016-01-04T08: 70 orzo dry_goods 0.19
213 2016-01-04T08: 4 clementines produce 1.19
213 2016-01-04T08: 22 smoked_trout meat 19.59
214 2016-01-03T15: 13 asparagus_waterbeverages 0.38
214 2016-01-03T15: 40 vegetable_gyozafrozen 1.17
214 2016-01-03T15: 60 satsuma_orangeproduce 2.06
214 2016-01-03T15: 41 frozen_tamales frozen 1.09
215 2016-01-04T15: 33 white_bean_andcanned_jarred_ 0.97
215 2016-01-04T15: 56 organic_glazed_ dry_goods 0.86
216 2016-01-05T18: 72 wild_rice dry_goods 0.27
216 2016-01-05T18: 32 arugula produce 2.99
216 2016-01-05T18: 27 celery_foam other 6
216 2016-01-05T18: 40 vegetable_gyozafrozen 1.17
216 2016-01-05T18: 36 olive_tapanade canned_jarred_ 1.12
217 2016-01-04T13: 12 vegan_egg_substdairy 1.15
217 2016-01-04T13: 52 cranberry_infus dairy 1.79
217 2016-01-04T13: 52 cranberry_infus dairy 1.79
218 2016-01-08T19: 33 white_bean_andcanned_jarred_ 0.97
218 2016-01-08T19: 45 butter_chicken frozen 1.29
220 2016-01-03T16: 14 falafel_chips snacks 0.53
220 2016-01-03T16: 2 apple_fuji produce 1.44
221 2016-01-04T14: 15 sweet_potato_h snacks 0.43
221 2016-01-04T14: 84 buckwheat_flourdry_goods 2.59
221 2016-01-04T14: 77 sugar_snap_peasproduce 2.67
222 2016-01-03T13: 41 frozen_tamales frozen 1.09
224 2016-01-06T17: 8 pluot produce 3.99
224 2016-01-06T17: 36 olive_tapanade canned_jarred_ 1.12
224 2016-01-06T17: 16 arugula_crisps snacks 2.43
225 2016-01-06T18: 65 purple_onions produce 1.32
226 2016-01-07T17: 32 arugula produce 2.99
226 2016-01-07T17: 54 aged_gouda dairy 1.23
226 2016-01-07T17: 52 cranberry_infus dairy 1.79
226 2016-01-07T17: 40 vegetable_gyozafrozen 1.17
227 2016-01-03T08: 20 sriracha_popcor snacks 1.11
228 2016-01-06T09: 12 vegan_egg_substdairy 1.15
229 2016-01-06T13: 68 salmonberries produce 0.67
229 2016-01-06T13: 19 all_natural_cheesnacks 0.41
229 2016-01-06T13: 26 green_juice beverages 0.25
229 2016-01-06T13: 70 orzo dry_goods 0.19
229 2016-01-06T13: 16 arugula_crisps snacks 2.43
229 2016-01-06T13: 79 darjeeling_black dry_goods 3.3
229 2016-01-06T13: 15 sweet_potato_h snacks 0.43
231 2016-01-07T16: 38 pork_gyoza frozen 1.19
231 2016-01-07T16: 61 grapefruits produce 0.55
232 2016-01-06T16: 32 arugula produce 2.99
232 2016-01-06T16: 8 pluot produce 3.99
232 2016-01-06T16: 41 frozen_tamales frozen 1.09
233 2016-01-08T10: 10 pomello produce 0.96
233 2016-01-08T10: 28 protein_powder dry_goods 0.69
235 2016-01-05T12: 32 arugula produce 2.99
235 2016-01-05T12: 22 smoked_trout meat 19.59
235 2016-01-05T12: 41 frozen_tamales frozen 1.09
235 2016-01-05T12: 21 buttermilk_pancsnacks 2.59
236 2016-01-04T15: 78 garam_masala dry_goods 1.44
236 2016-01-04T15: 55 parmigiano_reggdairy 1.1
236 2016-01-04T15: 11 pineberry produce 4.89
236 2016-01-04T15: 32 arugula produce 2.99
237 2016-01-04T19: 47 paneer dairy 1.17
237 2016-01-04T19: 20 sriracha_popcor snacks 1.11
238 2016-01-07T09: 66 yellow_onions produce 1.12
238 2016-01-07T09: 40 vegetable_gyozafrozen 1.17
239 2016-01-05T13: 36 olive_tapanade canned_jarred_ 1.12
239 2016-01-05T13: 9 tangelo produce 0.96
239 2016-01-05T13: 66 yellow_onions produce 1.12
239 2016-01-05T13: 17 bottled_organic_other 2.67
240 2016-01-03T18: 42 porchini_mushr produce 5.99
240 2016-01-03T18: 17 bottled_organic_other 2.67
240 2016-01-03T18: 52 cranberry_infus dairy 1.79
240 2016-01-03T18: 59 medjool_dates produce 4.29
240 2016-01-03T18: 66 yellow_onions produce 1.12
242 2016-01-04T11: 82 mango_black_tedry_goods 3.08
242 2016-01-04T11: 1 strawberry produce 3.28
243 2016-01-03T09: 12 vegan_egg_substdairy 1.15
243 2016-01-03T09: 79 darjeeling_black dry_goods 3.3
243 2016-01-03T09: 1 strawberry produce 3.28
243 2016-01-03T09: 11 pineberry produce 4.89
244 2016-01-07T17: 70 orzo dry_goods 0.19
244 2016-01-07T17: 43 garlic_naan bread 0.99
245 2016-01-06T08: 26 green_juice beverages 0.25
245 2016-01-06T08: 72 wild_rice dry_goods 0.27
245 2016-01-06T08: 78 garam_masala dry_goods 1.44
245 2016-01-06T08: 16 arugula_crisps snacks 2.43
245 2016-01-06T08: 9 tangelo produce 0.96
245 2016-01-06T08: 83 soy_ginger_trail snacks 0.39
246 2016-01-07T19: 8 pluot produce 3.99
246 2016-01-07T19: 43 garlic_naan bread 0.99
247 2016-01-07T14: 55 parmigiano_reggdairy 1.1
247 2016-01-07T14: 46 frozen_salmon frozen 16.99
249 2016-01-06T14: 80 rooibos_tea dry_goods 3.49
249 2016-01-06T14: 53 black_pepper_godairy 1.69
249 2016-01-06T14: 45 butter_chicken frozen 1.29
249 2016-01-06T14: 23 pine_nuts dry_goods 0.91
250 2016-01-05T15: 52 cranberry_infus dairy 1.79
250 2016-01-05T15: 57 Kumatos produce 3.6
251 2016-01-04T08: 7 tayberry produce 2.54
251 2016-01-04T08: 17 bottled_organic_other 2.67
252 2016-01-04T10: 64 white_onions produce 1.22
252 2016-01-04T10: 80 rooibos_tea dry_goods 3.49
253 2016-01-06T14: 41 frozen_tamales frozen 1.09
253 2016-01-06T14: 74 poppy_onion_sessnacks 0.75
253 2016-01-06T14: 7 tayberry produce 2.54
254 2016-01-04T13: 72 wild_rice dry_goods 0.27
254 2016-01-04T13: 3 orange produce 1.02
254 2016-01-04T13: 77 sugar_snap_peasproduce 2.67
254 2016-01-04T13: 60 satsuma_orangeproduce 2.06
255 2016-01-08T18: 26 green_juice beverages 0.25
256 2016-01-03T14: 54 aged_gouda dairy 1.23
256 2016-01-03T14: 84 buckwheat_flourdry_goods 2.59
258 2016-01-04T15: 39 table_wafers snacks 0.59
258 2016-01-04T15: 26 green_juice beverages 0.25
258 2016-01-04T15: 65 purple_onions produce 1.32
258 2016-01-04T15: 2 apple_fuji produce 1.44
258 2016-01-04T15: 39 table_wafers snacks 0.59
259 2016-01-08T18: 64 white_onions produce 1.22
259 2016-01-08T18: 12 vegan_egg_substdairy 1.15
259 2016-01-08T18: 64 white_onions produce 1.22
259 2016-01-08T18: 30 camembert_cheedairy 0.91
260 2016-01-08T11: 84 buckwheat_flourdry_goods 2.59
260 2016-01-08T11: 18 chia_seeds dry_goods 0.67
product_type_partial
produce VLOOKUP:
produce The VLOOKUP function in column D shows how Excel joins data from one table to another.
this, but typically cell D2 refers to an identifier that is also in row 2 (in this case, it's 'produ
used to look up data in another table (from the first VLOOKUP tab) and pull the appropriat
This is a little complicated, so if you don't know how it works and want more info, we sugg
produce https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93
VLOOKUP accomplishes the goal of taking data from one dataset and joining it onto the ne
Consider this scenario:
Imagine there were two rows in the lookup table for which the 'product_id' was equal to 3
particular dataset, but there are many instances in which you might perform a "many to m
D2 in this worksheet. The formula in that cell takes the product_id (in this case, 3), looks it
returns the product name. If there are two products with the same ID, which name should
produce the first value, but that may not always be correct. And when that's not the behavior you'd
you much of an alternative.
produce
There are other ways to merge data from two tables in Excel. HLOOKUP is very similar to V
combination of INDEX and MATCH (see here: http://fiveminutelessons.com/learn-microso
produce match-instead-vlookup). Unfortunately, neither of these address the underlying problem t
logically create new rows.
The lookup functions also slow down Excel a lot. If you're working with hundreds of thousa
downright unusable.
produce For starters, SQL can do 1:1, 1:many, and many:many joins. Moreover, SQL is smart enough
matter what, while Excel might give you misleading information. In the example above, Ex
with the same ID. SQL knows that there are two values with the same ID, so it creates an e
values—without any change in the code you write. In other words, SQL much more gracef
underlying data.
produce In order to get more robust with VLOOKUP, you have to add more functions into the mix (l
produce mentioned above), which complicates things and doesn't solve a lot of the problems inher
is hard to read and can get very messy quickly.
produce In this worksheet, we're using a simple example for which the correct results can be obtain
with a table containing transactions and we're joining two columns from another table: 'pr
'product_type'. Each row only has one 'product_id', so VLOOKUP will correctly find the ent
that 'product_id'. Fortunately, 'product_id' is unique in the other table —no two products
joining logic makes sense. In other words, this is a join that is actually possible in Excel. Th
joins that are possible (even easy) in SQL that are impossible to do in Excel without VBA pr
this easy one to compare how the two applications work on the same problem.
SQL can also incorporate conditional statements into joins, so that only a portion of either
Excel can do this too, but it requires at least one IF statement, and a few extra VLOOKUPs,
even more and are really tough to reason about. In SQL, it's really, really easy. To illustrate
produce 'product_type_partial' column that only joins the product type if the value should be "pro
produce attached SQL query that this is much easier in SQL.
Compare the output in the "Report" section here to that in the above query and check out
produce particularly powerful feature of SQL.
SQL School lessons on JOIN start here:
https://sqlschool.modeanalytics.com/intermediate/join-intro/
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
rom one table to another. There's a bit of flexibility in
2 (in this case, it's 'product_id'). That identifier is then
b) and pull the appropriate value.
torial/reports/6f71eb9a898b/queries/4e331243df46
ries/70371e75873e
bove query and check out the difference. This is a
at only a portion of either table is included in the join.
nd a few extra VLOOKUPs, which slow down the file
y, really easy. To illustrate this, we've added a
the value should be "produce." You can see in the
ries/70371e75873e
Aggregation:
It's tough to crown a given function as the most valuable in data analysis, but SUM and COUNT a
produce certainly in the running. Aggregation allows us to understand potentially huge volumes of data v
quickly. One of Excel's most popular features, pivot tables, highlights the value of exploring data
aggregations. More on those later. For now, here's a breakdown of Excel's standard aggregation
functionality.
Excel Aggregations:
You can see the magic in cells I2:L2. You've probably seen this magic before, but you might not h
noticed a few things:
You can put the aggregations anywhere in the sheet that you want. For everyday Excel users, thi
feel like a big deal—you can put anything in any cell. As mentioned in earlier worksheets, this fle
produce can lead to tricky situations. In this case, though, it's quite handy. As you can see, we have the e
produce dataset over on the left and the summary directly above this text box. The flexibility of the layou
excellent for making work easy to consume. SQL is much more rigid —if you want this exact layo
need to run two queries and then drop the data into Excel and format it.
produce
These functions are limited, though. They get more complicated when you want to aggregate on
that fits certain conditions. You have to use different functions if you want to segment, and ther
enough of them that it's hard to remember the differences (COUNT, COUNTA, COUNTIF, COUNT
COUNTBLANK...). Once you've written those functions, they're annoying to update and tough to
Pivot tables help solve this problem, but have their own issues.
produce One of the biggest problems with aggregating in Excel is that it's a challenge to count unique val
at cell J2—it's a smaller number than cell I2 because there are multiple rows per transaction. Th
produce sense, as one trip to the cash register might be to purchase multiple items. If you look at the for
you'll notice it's an unintuitive workaround (found here: https://exceljet.net/formula/count-uniq
in-a-range-with-countif).
SQL also doesn't break when the underlying data changes. You'll notice that the aggregation fun
produce above specify row numbers from row 2 to 595. If you were to add more data, you'd have to rem
update all those formulas.
What's new here is that it's much more intuitive to find distinct values in SQL. All you need to do
word "distinct." For some applications, this alone is worth switching the bulk of your work to SQ
Check out how this same set of aggregations happens in SQL:
https://modeanalytics.com/tutorial/reports/2d65f139ceda/queries/8da2b54d038c
produce
produce
https://sqlschool.modeanalytics.com/intermediate/aggregation-functions/
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
analysis, but SUM and COUNT are
tentially huge volumes of data very
ghts the value of exploring data through
of Excel's standard aggregation
ies/8da2b54d038c
functions/
functions/
product_type Average - Data Grouped Aggregations:
beverages In the previous worksheet we mentioned pivot tables and grouped ag
there's an example pivot table. It does some of the things that regula
bread can't do well—it makes it easy to add conditional statements to aggre
canned_jarred_goods changes in the type of aggregation, and it can find distinct values (sor
dairy
If you haven't used pivot tables before, we suggest you learn about th
dry_goods powerful. Here's a great resource: http://www.excel-easy.com/data-a
frozen
meat But pivot tables aren't perfect. They're not very responsive when new
you add data, you have to refresh the pivot table, and if you add mor
other that you've done so. In most cases, people just make new pivot table
produce big problems. Viewers typically assume that pivot tables are up to dat
snacks Pivot tables don't have Excel's biggest strength: flexibility. They can't
Total Result functions in cells. It's not easy to link them to cells outside the pivot t
pivot table, it can break the links.
Groupings are scripted, which means that they can easily be transferr
another, unlike in Excel where pivot tables have to be set up from scr
Here's an example that will produce the same results you see in this p
https://modeanalytics.com/tutorial/reports/d13dfea938c2/queries/2
In SQL, once you have made an aggregation, you can filter on that agg
HAVING clause) or build upon it easily (using an outer query).
s in SQL here:
ntermediate/grouped-aggregations/