Académique Documents
Professionnel 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/
for learning SQL. For
SQL, check out this
n of the function(s)
a complete tutorial by
gest cases where it's
ces to execute these
platform used by
n this file are pre-
ok. You can look at the
out some SQL yourself
ytics.com
ach cell is treated as its own entity —it's not necessarily tied
cells, but when you open a new worksheet, each cell stands
cell in the 'margin' column with a value in it. I2 references
t as easily reference information anywhere in this worksheet
any cell.
htforward:
rts/12b52e961f5f/queries/4525b41bfd56
fuctions people learn in Excel. Here it's used to create the 'category' column.
want to create three categories, and that requires an IF statement nested inside another IF
o big deal. But with each new category, the IF statement becomes more complex and messy.
sons why nesting multiple conditions is tricky:
:
is very similar to the semantic example above.
condition is met> THEN <display this value> OTHERWISE <display a different value>
ASE WHEN <some condition is met> THEN <display this value> ELSE <display a different value>
e here is that SQL queries aren't restricted to single line. That makes it easy to nest many
into one column. Doing so would look like this:
ort" link at the top, you will see that the output matches this Excel worksheet.
o read.
you to write on multiple lines, which is conducive to adding complex conditions.
know one syntax for CASE, as opposed to Excel's IF statement with its many variations (see
l isn't very flexible when it comes to filtering. You can't apply filters to just any
only really work when applied to a row of column headers, and they work best
all column headers at once.
ready been added to this worksheet. If you want to add filters to another
the cells in row 1 (in this case, A1 through J1) and click the "Filter" icon (the one
unnel) in the top navigation bar.
et by a specific column, click the arrow next to that column name. You can filter
fic values from the list or by selecting options (equal to, less than, greater than,
pdown menu.
that when you can see results as soon as you turn on a filter, so you can quickly
w else you might want to filter the data.
e limitations:
ee all the filters you have applied to a dataset at a given time.
or adding new filters is a little clunky.
be applied programmatically, so you have to set them all individually each time
use:
filtering datasets is very simple —you simply specify the column name you want
a conditional statement using the WHERE claus:
= 'medium'
and OR to string together sets of conditions similar to how you would use AND
= 'medium'
00
ort" link at the top will show the output. As an exercise, try making this output
tput using the filters in this worksheet. Side note: check out what happens to
n you apply the filters.
el's weaknesses are SQL's strengths. Because the filters you've applied are written
u can see, add, and subtract them without digging around.
WHERE clause to filter data out of very large datasets. It's handy to be able to pare
n SQL because Excel can only handle a little over a million rows of data.
food sales data. Skip to the next worksheet to see how this is executed in Excel
aset shows grocery information, the same patterns exist elsewhere. For example,
users and we could be joining it onto a list of all transactions made by those
transaction_id time product_id product_name product_type price/unit
1 2016-01-08T17:4 3 orange produce 1.02
1 2016-01-08T17:4 61 grapefruits produce 0.55
2 2016-01-07T14:1 23 pine_nuts dry_goods 0.91
4 2016-01-06T17:5 52 cranberry_infuse dairy 1.79
4 2016-01-06T17:5 4 clementines produce 1.19
4 2016-01-06T17:5 76 cheddar_whales snacks 0.69
5 2016-01-07T14:5 45 butter_chicken frozen 1.29
7 2016-01-07T12:0 17 bottled_organic_aother 2.67
7 2016-01-07T12:0 31 almond_nut_thinsnacks 0.61
7 2016-01-07T12:0 21 buttermilk_pancasnacks 2.59
7 2016-01-07T12:0 47 paneer dairy 1.17
7 2016-01-07T12:0 44 frozen_clams frozen 4.99
8 2016-01-07T09:3 8 pluot produce 3.99
8 2016-01-07T09:3 60 satsuma_orangesproduce 2.06
8 2016-01-07T09:3 38 pork_gyoza frozen 1.19
8 2016-01-07T09:3 64 white_onions produce 1.22
9 2016-01-03T09:0 12 vegan_egg_substidairy 1.15
9 2016-01-03T09:0 14 falafel_chips snacks 0.53
9 2016-01-03T09:0 17 bottled_organic_aother 2.67
9 2016-01-03T09:0 70 orzo dry_goods 0.19
9 2016-01-03T09:0 10 pomello produce 0.96
10 2016-01-04T08:4 18 chia_seeds dry_goods 0.67
11 2016-01-08T11:4 77 sugar_snap_peasproduce 2.67
11 2016-01-08T11:4 25 smoked_salmon meat 39.99
11 2016-01-08T11:4 47 paneer dairy 1.17
11 2016-01-08T11:4 36 olive_tapanade canned_jarred_ 1.12
11 2016-01-08T11:4 10 pomello produce 0.96
12 2016-01-04T17:4 66 yellow_onions produce 1.12
13 2016-01-04T13:2 21 buttermilk_pancasnacks 2.59
15 2016-01-05T09:1 42 porchini_mushroproduce 5.99
15 2016-01-05T09:1 56 organic_glazed_wdry_goods 0.86
15 2016-01-05T09:1 29 asiago_cheese dairy 0.63
16 2016-01-05T14:2 36 olive_tapanade canned_jarred_ 1.12
16 2016-01-05T14:2 41 frozen_tamales frozen 1.09
16 2016-01-05T14:2 22 smoked_trout meat 19.59
17 2016-01-07T18:5 73 cheddar_corn_stisnacks 0.69
17 2016-01-07T18:5 41 frozen_tamales frozen 1.09
19 2016-01-04T12:2 76 cheddar_whales snacks 0.69
19 2016-01-04T12:2 71 autumn_pilaf dry_goods 0.24
20 2016-01-04T10:0 6 blood_lime produce 1.69
20 2016-01-04T10:0 6 blood_lime produce 1.69
20 2016-01-04T10:0 29 asiago_cheese dairy 0.63
20 2016-01-04T10:0 10 pomello produce 0.96
21 2016-01-05T09:2 47 paneer dairy 1.17
21 2016-01-05T09:2 68 salmonberries produce 0.67
21 2016-01-05T09:2 52 cranberry_infuse dairy 1.79
21 2016-01-05T09:2 41 frozen_tamales frozen 1.09
22 2016-01-06T14:3 14 falafel_chips snacks 0.53
22 2016-01-06T14:3 27 celery_foam other 6
23 2016-01-07T09:0 67 barberries dry_goods 1.74
23 2016-01-07T09:0 13 asparagus_water beverages 0.38
23 2016-01-07T09:0 55 parmigiano_reggidairy 1.1
23 2016-01-07T09:0 69 wholewheat_cousdry_goods 0.27
24 2016-01-03T10:4 54 aged_gouda dairy 1.23
24 2016-01-03T10:4 3 orange produce 1.02
25 2016-01-06T19:0 83 soy_ginger_trail_snacks 0.39
26 2016-01-06T08:4 26 green_juice beverages 0.25
26 2016-01-06T08:4 22 smoked_trout meat 19.59
26 2016-01-06T08:4 5 blood_orange produce 3.86
26 2016-01-06T08:4 32 arugula produce 2.99
26 2016-01-06T08:4 47 paneer dairy 1.17
27 2016-01-07T17:5 51 english_cheddar dairy 0.89
27 2016-01-07T17:5 40 vegetable_gyoza frozen 1.17
27 2016-01-07T17:5 48 organic_mung_bedry_goods 0.89
29 2016-01-07T12:2 28 protein_powder dry_goods 0.69
30 2016-01-05T13:5 68 salmonberries produce 0.67
31 2016-01-05T13:1 3 orange produce 1.02
32 2016-01-04T19:3 65 purple_onions produce 1.32
32 2016-01-04T19:3 7 tayberry produce 2.54
32 2016-01-04T19:3 67 barberries dry_goods 1.74
32 2016-01-04T19:3 7 tayberry produce 2.54
32 2016-01-04T19:3 3 orange produce 1.02
33 2016-01-03T11:1 72 wild_rice dry_goods 0.27
34 2016-01-08T12:3 84 buckwheat_flour dry_goods 2.59
35 2016-01-05T16:0 65 purple_onions produce 1.32
35 2016-01-05T16:0 14 falafel_chips snacks 0.53
35 2016-01-05T16:0 44 frozen_clams frozen 4.99
36 2016-01-07T16:1 59 medjool_dates produce 4.29
36 2016-01-07T16:1 63 organic_garlic produce 3.57
37 2016-01-06T15:3 52 cranberry_infuse dairy 1.79
37 2016-01-06T15:3 19 all_natural_chee snacks 0.41
37 2016-01-06T15:3 8 pluot produce 3.99
38 2016-01-06T13:1 69 wholewheat_cousdry_goods 0.27
39 2016-01-08T16:4 66 yellow_onions produce 1.12
39 2016-01-08T16:4 24 dried_apricots dry_goods 0.56
40 2016-01-03T10:4 7 tayberry produce 2.54
40 2016-01-03T10:4 1 strawberry produce 3.28
40 2016-01-03T10:4 17 bottled_organic_aother 2.67
41 2016-01-05T14:4 52 cranberry_infuse dairy 1.79
41 2016-01-05T14:4 61 grapefruits produce 0.55
41 2016-01-05T14:4 62 goji_berries dry_goods 1.17
42 2016-01-05T11:3 77 sugar_snap_peasproduce 2.67
43 2016-01-03T19:0 2 apple_fuji produce 1.44
43 2016-01-03T19:0 41 frozen_tamales frozen 1.09
44 2016-01-06T17:0 56 organic_glazed_wdry_goods 0.86
44 2016-01-06T17:0 75 rice_crackers snacks 0.57
45 2016-01-07T08:2 75 rice_crackers snacks 0.57
45 2016-01-07T08:2 40 vegetable_gyoza frozen 1.17
45 2016-01-07T08:2 39 table_wafers snacks 0.59
45 2016-01-07T08:2 51 english_cheddar dairy 0.89
45 2016-01-07T08:2 52 cranberry_infuse dairy 1.79
46 2016-01-03T09:1 63 organic_garlic produce 3.57
46 2016-01-03T09:1 43 garlic_naan bread 0.99
47 2016-01-07T17:5 28 protein_powder dry_goods 0.69
48 2016-01-08T15:4 30 camembert_cheedairy 0.91
48 2016-01-08T15:4 23 pine_nuts dry_goods 0.91
48 2016-01-08T15:4 18 chia_seeds dry_goods 0.67
48 2016-01-08T15:4 20 sriracha_popcornsnacks 1.11
49 2016-01-07T17:5 67 barberries dry_goods 1.74
49 2016-01-07T17:5 53 black_pepper_godairy 1.69
50 2016-01-06T14:5 56 organic_glazed_wdry_goods 0.86
50 2016-01-06T14:5 80 rooibos_tea dry_goods 3.49
52 2016-01-05T15:4 50 white_cheddar dairy 0.77
52 2016-01-05T15:4 13 asparagus_water beverages 0.38
52 2016-01-05T15:4 44 frozen_clams frozen 4.99
53 2016-01-06T11:5 61 grapefruits produce 0.55
53 2016-01-06T11:5 33 white_bean_and canned_jarred_ 0.97
53 2016-01-06T11:5 36 olive_tapanade canned_jarred_ 1.12
53 2016-01-06T11:5 29 asiago_cheese dairy 0.63
54 2016-01-03T08:5 20 sriracha_popcornsnacks 1.11
54 2016-01-03T08:5 79 darjeeling_black_dry_goods 3.3
55 2016-01-05T19:1 8 pluot produce 3.99
55 2016-01-05T19:1 76 cheddar_whales snacks 0.69
56 2016-01-03T12:2 62 goji_berries dry_goods 1.17
56 2016-01-03T12:2 70 orzo dry_goods 0.19
57 2016-01-07T19:3 81 irish_breakfast_bdry_goods 2.99
57 2016-01-07T19:3 64 white_onions produce 1.22
57 2016-01-07T19:3 11 pineberry produce 4.89
58 2016-01-08T09:5 79 darjeeling_black_dry_goods 3.3
58 2016-01-08T09:5 37 chocolate_ganachfrozen 3.52
58 2016-01-08T09:5 39 table_wafers snacks 0.59
58 2016-01-08T09:5 27 celery_foam other 6
59 2016-01-08T14:3 4 clementines produce 1.19
60 2016-01-03T13:5 51 english_cheddar dairy 0.89
60 2016-01-03T13:5 13 asparagus_water beverages 0.38
60 2016-01-03T13:5 78 garam_masala dry_goods 1.44
61 2016-01-03T09:1 22 smoked_trout meat 19.59
61 2016-01-03T09:1 31 almond_nut_thinsnacks 0.61
61 2016-01-03T09:1 46 frozen_salmon frozen 16.99
61 2016-01-03T09:1 46 frozen_salmon frozen 16.99
62 2016-01-07T14:3 56 organic_glazed_wdry_goods 0.86
63 2016-01-06T18:5 16 arugula_crisps snacks 2.43
64 2016-01-06T18:3 16 arugula_crisps snacks 2.43
64 2016-01-06T18:3 70 orzo dry_goods 0.19
64 2016-01-06T18:3 22 smoked_trout meat 19.59
65 2016-01-07T16:4 50 white_cheddar dairy 0.77
65 2016-01-07T16:4 29 asiago_cheese dairy 0.63
65 2016-01-07T16:4 58 pumpkin_spice_pdry_goods 0.96
66 2016-01-08T16:4 39 table_wafers snacks 0.59
67 2016-01-04T19:0 55 parmigiano_reggidairy 1.1
67 2016-01-04T19:0 49 silken_tofu dairy 0.67
67 2016-01-04T19:0 67 barberries dry_goods 1.74
68 2016-01-03T19:4 36 olive_tapanade canned_jarred_ 1.12
69 2016-01-05T09:0 82 mango_black_teadry_goods 3.08
69 2016-01-05T09:0 55 parmigiano_reggidairy 1.1
69 2016-01-05T09:0 60 satsuma_orangesproduce 2.06
69 2016-01-05T09:0 62 goji_berries dry_goods 1.17
70 2016-01-06T11:5 21 buttermilk_pancasnacks 2.59
70 2016-01-06T11:5 81 irish_breakfast_bdry_goods 2.99
70 2016-01-06T11:5 56 organic_glazed_wdry_goods 0.86
71 2016-01-04T11:1 74 poppy_onion_sessnacks 0.75
72 2016-01-06T19:1 30 camembert_cheedairy 0.91
72 2016-01-06T19:1 19 all_natural_chee snacks 0.41
72 2016-01-06T19:1 67 barberries dry_goods 1.74
72 2016-01-06T19:1 42 porchini_mushroproduce 5.99
73 2016-01-07T11:5 81 irish_breakfast_bdry_goods 2.99
73 2016-01-07T11:5 24 dried_apricots dry_goods 0.56
73 2016-01-07T11:5 20 sriracha_popcornsnacks 1.11
74 2016-01-07T19:4 21 buttermilk_pancasnacks 2.59
74 2016-01-07T19:4 36 olive_tapanade canned_jarred_ 1.12
75 2016-01-04T13:3 11 pineberry produce 4.89
75 2016-01-04T13:3 72 wild_rice dry_goods 0.27
76 2016-01-06T12:2 57 Kumatos produce 3.6
76 2016-01-06T12:2 73 cheddar_corn_stisnacks 0.69
77 2016-01-06T14:2 28 protein_powder dry_goods 0.69
78 2016-01-06T09:0 76 cheddar_whales snacks 0.69
78 2016-01-06T09:0 25 smoked_salmon meat 39.99
78 2016-01-06T09:0 2 apple_fuji produce 1.44
78 2016-01-06T09:0 12 vegan_egg_substidairy 1.15
79 2016-01-05T19:4 9 tangelo produce 0.96
79 2016-01-05T19:4 10 pomello produce 0.96
79 2016-01-05T19:4 16 arugula_crisps snacks 2.43
81 2016-01-03T09:1 65 purple_onions produce 1.32
82 2016-01-04T18:0 17 bottled_organic_aother 2.67
82 2016-01-04T18:0 20 sriracha_popcornsnacks 1.11
82 2016-01-04T18:0 14 falafel_chips snacks 0.53
82 2016-01-04T18:0 27 celery_foam other 6
83 2016-01-08T12:5 60 satsuma_orangesproduce 2.06
84 2016-01-08T19:5 67 barberries dry_goods 1.74
84 2016-01-08T19:5 77 sugar_snap_peasproduce 2.67
85 2016-01-07T12:5 79 darjeeling_black_dry_goods 3.3
85 2016-01-07T12:5 81 irish_breakfast_bdry_goods 2.99
86 2016-01-07T09:3 9 tangelo produce 0.96
86 2016-01-07T09:3 42 porchini_mushroproduce 5.99
86 2016-01-07T09:3 69 wholewheat_cousdry_goods 0.27
86 2016-01-07T09:3 76 cheddar_whales snacks 0.69
87 2016-01-05T11:5 63 organic_garlic produce 3.57
87 2016-01-05T11:5 78 garam_masala dry_goods 1.44
88 2016-01-04T16:0 82 mango_black_teadry_goods 3.08
88 2016-01-04T16:0 69 wholewheat_cousdry_goods 0.27
88 2016-01-04T16:0 81 irish_breakfast_bdry_goods 2.99
88 2016-01-04T16:0 78 garam_masala dry_goods 1.44
88 2016-01-04T16:0 80 rooibos_tea dry_goods 3.49
89 2016-01-06T17:5 58 pumpkin_spice_pdry_goods 0.96
90 2016-01-05T08:4 57 Kumatos produce 3.6
90 2016-01-05T08:4 19 all_natural_chee snacks 0.41
91 2016-01-07T12:1 26 green_juice beverages 0.25
91 2016-01-07T12:1 13 asparagus_water beverages 0.38
91 2016-01-07T12:1 2 apple_fuji produce 1.44
91 2016-01-07T12:1 35 eggplant_caponatfrozen 1.39
92 2016-01-08T12:0 6 blood_lime produce 1.69
93 2016-01-04T17:5 23 pine_nuts dry_goods 0.91
93 2016-01-04T17:5 46 frozen_salmon frozen 16.99
93 2016-01-04T17:5 21 buttermilk_pancasnacks 2.59
94 2016-01-04T10:4 11 pineberry produce 4.89
94 2016-01-04T10:4 64 white_onions produce 1.22
95 2016-01-08T14:0 15 sweet_potato_hosnacks 0.43
96 2016-01-04T16:4 76 cheddar_whales snacks 0.69
97 2016-01-08T12:2 7 tayberry produce 2.54
97 2016-01-08T12:2 40 vegetable_gyoza frozen 1.17
97 2016-01-08T12:2 38 pork_gyoza frozen 1.19
97 2016-01-08T12:2 36 olive_tapanade canned_jarred_ 1.12
98 2016-01-04T19:4 75 rice_crackers snacks 0.57
98 2016-01-04T19:4 35 eggplant_caponatfrozen 1.39
99 2016-01-06T19:0 15 sweet_potato_hosnacks 0.43
99 2016-01-06T19:0 40 vegetable_gyoza frozen 1.17
100 2016-01-05T16:3 78 garam_masala dry_goods 1.44
100 2016-01-05T16:3 2 apple_fuji produce 1.44
100 2016-01-05T16:3 64 white_onions produce 1.22
100 2016-01-05T16:3 13 asparagus_water beverages 0.38
101 2016-01-04T19:2 78 garam_masala dry_goods 1.44
101 2016-01-04T19:2 48 organic_mung_bedry_goods 0.89
101 2016-01-04T19:2 17 bottled_organic_aother 2.67
101 2016-01-04T19:2 15 sweet_potato_hosnacks 0.43
102 2016-01-04T18:4 48 organic_mung_bedry_goods 0.89
102 2016-01-04T18:4 39 table_wafers snacks 0.59
102 2016-01-04T18:4 35 eggplant_caponatfrozen 1.39
103 2016-01-05T17:0 57 Kumatos produce 3.6
103 2016-01-05T17:0 72 wild_rice dry_goods 0.27
103 2016-01-05T17:0 51 english_cheddar dairy 0.89
104 2016-01-08T08:1 75 rice_crackers snacks 0.57
104 2016-01-08T08:1 42 porchini_mushroproduce 5.99
104 2016-01-08T08:1 17 bottled_organic_aother 2.67
105 2016-01-08T10:3 81 irish_breakfast_bdry_goods 2.99
105 2016-01-08T10:3 24 dried_apricots dry_goods 0.56
105 2016-01-08T10:3 57 Kumatos produce 3.6
106 2016-01-03T09:4 57 Kumatos produce 3.6
106 2016-01-03T09:4 46 frozen_salmon frozen 16.99
106 2016-01-03T09:4 38 pork_gyoza frozen 1.19
106 2016-01-03T09:4 36 olive_tapanade canned_jarred_ 1.12
106 2016-01-03T09:4 34 edamame_hummcanned_jarred_ 0.95
106 2016-01-03T09:4 60 satsuma_orangesproduce 2.06
107 2016-01-08T17:5 12 vegan_egg_substidairy 1.15
108 2016-01-04T12:4 5 blood_orange produce 3.86
108 2016-01-04T12:4 27 celery_foam other 6
108 2016-01-04T12:4 25 smoked_salmon meat 39.99
109 2016-01-06T11:2 78 garam_masala dry_goods 1.44
109 2016-01-06T11:2 37 chocolate_ganachfrozen 3.52
109 2016-01-06T11:2 59 medjool_dates produce 4.29
110 2016-01-08T10:4 70 orzo dry_goods 0.19
111 2016-01-05T19:4 46 frozen_salmon frozen 16.99
112 2016-01-07T10:0 11 pineberry produce 4.89
112 2016-01-07T10:0 72 wild_rice dry_goods 0.27
113 2016-01-08T14:3 65 purple_onions produce 1.32
113 2016-01-08T14:3 27 celery_foam other 6
114 2016-01-05T11:2 77 sugar_snap_peasproduce 2.67
114 2016-01-05T11:2 13 asparagus_water beverages 0.38
116 2016-01-05T11:2 11 pineberry produce 4.89
116 2016-01-05T11:2 37 chocolate_ganachfrozen 3.52
117 2016-01-05T13:2 9 tangelo produce 0.96
118 2016-01-06T14:2 23 pine_nuts dry_goods 0.91
118 2016-01-06T14:2 40 vegetable_gyoza frozen 1.17
118 2016-01-06T14:2 75 rice_crackers snacks 0.57
118 2016-01-06T14:2 8 pluot produce 3.99
118 2016-01-06T14:2 18 chia_seeds dry_goods 0.67
118 2016-01-06T14:2 48 organic_mung_bedry_goods 0.89
119 2016-01-03T15:5 76 cheddar_whales snacks 0.69
120 2016-01-03T14:5 53 black_pepper_godairy 1.69
120 2016-01-03T14:5 63 organic_garlic produce 3.57
120 2016-01-03T14:5 7 tayberry produce 2.54
121 2016-01-08T14:4 32 arugula produce 2.99
121 2016-01-08T14:4 20 sriracha_popcornsnacks 1.11
121 2016-01-08T14:4 63 organic_garlic produce 3.57
121 2016-01-08T14:4 27 celery_foam other 6
123 2016-01-08T10:0 49 silken_tofu dairy 0.67
123 2016-01-08T10:0 58 pumpkin_spice_pdry_goods 0.96
123 2016-01-08T10:0 19 all_natural_chee snacks 0.41
124 2016-01-03T08:2 83 soy_ginger_trail_snacks 0.39
124 2016-01-03T08:2 44 frozen_clams frozen 4.99
126 2016-01-03T12:3 4 clementines produce 1.19
127 2016-01-04T09:1 40 vegetable_gyoza frozen 1.17
127 2016-01-04T09:1 5 blood_orange produce 3.86
128 2016-01-03T15:1 36 olive_tapanade canned_jarred_ 1.12
128 2016-01-03T15:1 15 sweet_potato_hosnacks 0.43
129 2016-01-06T19:1 21 buttermilk_pancasnacks 2.59
129 2016-01-06T19:1 55 parmigiano_reggidairy 1.1
130 2016-01-06T16:5 71 autumn_pilaf dry_goods 0.24
130 2016-01-06T16:5 55 parmigiano_reggidairy 1.1
131 2016-01-06T19:2 4 clementines produce 1.19
133 2016-01-07T18:5 59 medjool_dates produce 4.29
133 2016-01-07T18:5 72 wild_rice dry_goods 0.27
134 2016-01-04T17:5 33 white_bean_and canned_jarred_ 0.97
134 2016-01-04T17:5 49 silken_tofu dairy 0.67
134 2016-01-04T17:5 69 wholewheat_cousdry_goods 0.27
135 2016-01-03T15:2 15 sweet_potato_hosnacks 0.43
135 2016-01-03T15:2 11 pineberry produce 4.89
136 2016-01-06T12:3 73 cheddar_corn_stisnacks 0.69
136 2016-01-06T12:3 27 celery_foam other 6
136 2016-01-06T12:3 10 pomello produce 0.96
137 2016-01-03T14:4 39 table_wafers snacks 0.59
137 2016-01-03T14:4 84 buckwheat_flour dry_goods 2.59
138 2016-01-08T17:3 13 asparagus_water beverages 0.38
138 2016-01-08T17:3 55 parmigiano_reggidairy 1.1
138 2016-01-08T17:3 40 vegetable_gyoza frozen 1.17
138 2016-01-08T17:3 5 blood_orange produce 3.86
139 2016-01-03T19:4 54 aged_gouda dairy 1.23
139 2016-01-03T19:4 69 wholewheat_cousdry_goods 0.27
139 2016-01-03T19:4 2 apple_fuji produce 1.44
139 2016-01-03T19:4 31 almond_nut_thinsnacks 0.61
142 2016-01-06T14:2 73 cheddar_corn_stisnacks 0.69
142 2016-01-06T14:2 31 almond_nut_thinsnacks 0.61
142 2016-01-06T14:2 24 dried_apricots dry_goods 0.56
143 2016-01-06T08:4 73 cheddar_corn_stisnacks 0.69
143 2016-01-06T08:4 77 sugar_snap_peasproduce 2.67
143 2016-01-06T08:4 84 buckwheat_flour dry_goods 2.59
144 2016-01-05T19:1 46 frozen_salmon frozen 16.99
145 2016-01-05T13:2 52 cranberry_infuse dairy 1.79
145 2016-01-05T13:2 79 darjeeling_black_dry_goods 3.3
146 2016-01-03T13:0 31 almond_nut_thinsnacks 0.61
147 2016-01-08T17:2 52 cranberry_infuse dairy 1.79
147 2016-01-08T17:2 39 table_wafers snacks 0.59
147 2016-01-08T17:2 58 pumpkin_spice_pdry_goods 0.96
148 2016-01-03T18:3 15 sweet_potato_hosnacks 0.43
149 2016-01-08T15:5 71 autumn_pilaf dry_goods 0.24
149 2016-01-08T15:5 54 aged_gouda dairy 1.23
151 2016-01-06T17:4 9 tangelo produce 0.96
151 2016-01-06T17:4 12 vegan_egg_substidairy 1.15
151 2016-01-06T17:4 13 asparagus_water beverages 0.38
152 2016-01-03T12:3 84 buckwheat_flour dry_goods 2.59
152 2016-01-03T12:3 65 purple_onions produce 1.32
153 2016-01-06T08:5 1 strawberry produce 3.28
153 2016-01-06T08:5 56 organic_glazed_wdry_goods 0.86
154 2016-01-06T14:2 54 aged_gouda dairy 1.23
154 2016-01-06T14:2 64 white_onions produce 1.22
155 2016-01-07T18:3 12 vegan_egg_substidairy 1.15
155 2016-01-07T18:3 69 wholewheat_cousdry_goods 0.27
156 2016-01-06T19:2 37 chocolate_ganachfrozen 3.52
157 2016-01-04T14:5 8 pluot produce 3.99
157 2016-01-04T14:5 8 pluot produce 3.99
157 2016-01-04T14:5 61 grapefruits produce 0.55
158 2016-01-08T12:2 9 tangelo produce 0.96
158 2016-01-08T12:2 29 asiago_cheese dairy 0.63
158 2016-01-08T12:2 72 wild_rice dry_goods 0.27
158 2016-01-08T12:2 54 aged_gouda dairy 1.23
158 2016-01-08T12:2 47 paneer dairy 1.17
159 2016-01-04T12:3 77 sugar_snap_peasproduce 2.67
159 2016-01-04T12:3 25 smoked_salmon meat 39.99
159 2016-01-04T12:3 78 garam_masala dry_goods 1.44
160 2016-01-04T19:2 1 strawberry produce 3.28
160 2016-01-04T19:2 13 asparagus_water beverages 0.38
160 2016-01-04T19:2 32 arugula produce 2.99
161 2016-01-03T14:0 40 vegetable_gyoza frozen 1.17
162 2016-01-05T13:2 55 parmigiano_reggidairy 1.1
162 2016-01-05T13:2 61 grapefruits produce 0.55
163 2016-01-03T10:1 3 orange produce 1.02
163 2016-01-03T10:1 6 blood_lime produce 1.69
163 2016-01-03T10:1 62 goji_berries dry_goods 1.17
163 2016-01-03T10:1 26 green_juice beverages 0.25
163 2016-01-03T10:1 51 english_cheddar dairy 0.89
163 2016-01-03T10:1 60 satsuma_orangesproduce 2.06
164 2016-01-06T19:2 2 apple_fuji produce 1.44
164 2016-01-06T19:2 31 almond_nut_thinsnacks 0.61
164 2016-01-06T19:2 58 pumpkin_spice_pdry_goods 0.96
165 2016-01-03T19:0 28 protein_powder dry_goods 0.69
165 2016-01-03T19:0 57 Kumatos produce 3.6
166 2016-01-04T18:5 63 organic_garlic produce 3.57
166 2016-01-04T18:5 70 orzo dry_goods 0.19
167 2016-01-05T16:4 79 darjeeling_black_dry_goods 3.3
168 2016-01-06T17:2 39 table_wafers snacks 0.59
168 2016-01-06T17:2 65 purple_onions produce 1.32
169 2016-01-06T08:0 37 chocolate_ganachfrozen 3.52
169 2016-01-06T08:0 44 frozen_clams frozen 4.99
170 2016-01-04T16:2 2 apple_fuji produce 1.44
170 2016-01-04T16:2 74 poppy_onion_sessnacks 0.75
170 2016-01-04T16:2 9 tangelo produce 0.96
171 2016-01-08T17:5 78 garam_masala dry_goods 1.44
171 2016-01-08T17:5 43 garlic_naan bread 0.99
171 2016-01-08T17:5 18 chia_seeds dry_goods 0.67
172 2016-01-08T08:0 46 frozen_salmon frozen 16.99
172 2016-01-08T08:0 82 mango_black_teadry_goods 3.08
173 2016-01-05T08:5 42 porchini_mushroproduce 5.99
173 2016-01-05T08:5 59 medjool_dates produce 4.29
173 2016-01-05T08:5 71 autumn_pilaf dry_goods 0.24
174 2016-01-04T18:1 56 organic_glazed_wdry_goods 0.86
174 2016-01-04T18:1 49 silken_tofu dairy 0.67
174 2016-01-04T18:1 30 camembert_cheedairy 0.91
175 2016-01-03T11:5 15 sweet_potato_hosnacks 0.43
175 2016-01-03T11:5 48 organic_mung_bedry_goods 0.89
175 2016-01-03T11:5 79 darjeeling_black_dry_goods 3.3
176 2016-01-06T16:2 71 autumn_pilaf dry_goods 0.24
176 2016-01-06T16:2 53 black_pepper_godairy 1.69
176 2016-01-06T16:2 63 organic_garlic produce 3.57
176 2016-01-06T16:2 77 sugar_snap_peasproduce 2.67
177 2016-01-03T11:1 66 yellow_onions produce 1.12
177 2016-01-03T11:1 44 frozen_clams frozen 4.99
177 2016-01-03T11:1 43 garlic_naan bread 0.99
178 2016-01-06T13:4 39 table_wafers snacks 0.59
178 2016-01-06T13:4 51 english_cheddar dairy 0.89
179 2016-01-08T12:4 22 smoked_trout meat 19.59
179 2016-01-08T12:4 36 olive_tapanade canned_jarred_ 1.12
180 2016-01-07T08:1 26 green_juice beverages 0.25
182 2016-01-06T12:5 36 olive_tapanade canned_jarred_ 1.12
182 2016-01-06T12:5 29 asiago_cheese dairy 0.63
182 2016-01-06T12:5 6 blood_lime produce 1.69
183 2016-01-05T14:1 16 arugula_crisps snacks 2.43
184 2016-01-08T10:1 6 blood_lime produce 1.69
185 2016-01-07T11:0 11 pineberry produce 4.89
185 2016-01-07T11:0 22 smoked_trout meat 19.59
186 2016-01-06T09:1 74 poppy_onion_sessnacks 0.75
186 2016-01-06T09:1 54 aged_gouda dairy 1.23
187 2016-01-08T11:5 16 arugula_crisps snacks 2.43
187 2016-01-08T11:5 23 pine_nuts dry_goods 0.91
187 2016-01-08T11:5 4 clementines produce 1.19
187 2016-01-08T11:5 69 wholewheat_cousdry_goods 0.27
188 2016-01-03T17:5 12 vegan_egg_substidairy 1.15
190 2016-01-08T08:5 27 celery_foam other 6
190 2016-01-08T08:5 24 dried_apricots dry_goods 0.56
190 2016-01-08T08:5 33 white_bean_and canned_jarred_ 0.97
190 2016-01-08T08:5 77 sugar_snap_peasproduce 2.67
190 2016-01-08T08:5 40 vegetable_gyoza frozen 1.17
191 2016-01-08T10:5 78 garam_masala dry_goods 1.44
191 2016-01-08T10:5 32 arugula produce 2.99
192 2016-01-04T19:2 22 smoked_trout meat 19.59
192 2016-01-04T19:2 73 cheddar_corn_stisnacks 0.69
193 2016-01-06T11:1 62 goji_berries dry_goods 1.17
193 2016-01-06T11:1 61 grapefruits produce 0.55
194 2016-01-08T19:2 54 aged_gouda dairy 1.23
194 2016-01-08T19:2 45 butter_chicken frozen 1.29
194 2016-01-08T19:2 31 almond_nut_thinsnacks 0.61
195 2016-01-07T12:3 65 purple_onions produce 1.32
195 2016-01-07T12:3 32 arugula produce 2.99
195 2016-01-07T12:3 34 edamame_hummcanned_jarred_ 0.95
195 2016-01-07T12:3 59 medjool_dates produce 4.29
196 2016-01-08T16:3 66 yellow_onions produce 1.12
199 2016-01-04T08:3 34 edamame_hummcanned_jarred_ 0.95
199 2016-01-04T08:3 60 satsuma_orangesproduce 2.06
200 2016-01-08T18:1 46 frozen_salmon frozen 16.99
201 2016-01-03T08:1 9 tangelo produce 0.96
201 2016-01-03T08:1 24 dried_apricots dry_goods 0.56
202 2016-01-07T16:4 81 irish_breakfast_bdry_goods 2.99
202 2016-01-07T16:4 80 rooibos_tea dry_goods 3.49
202 2016-01-07T16:4 43 garlic_naan bread 0.99
203 2016-01-08T11:5 67 barberries dry_goods 1.74
203 2016-01-08T11:5 60 satsuma_orangesproduce 2.06
203 2016-01-08T11:5 14 falafel_chips snacks 0.53
204 2016-01-08T11:1 27 celery_foam other 6
204 2016-01-08T11:1 41 frozen_tamales frozen 1.09
204 2016-01-08T11:1 22 smoked_trout meat 19.59
205 2016-01-07T15:3 51 english_cheddar dairy 0.89
205 2016-01-07T15:3 29 asiago_cheese dairy 0.63
206 2016-01-05T19:3 67 barberries dry_goods 1.74
207 2016-01-03T19:3 58 pumpkin_spice_pdry_goods 0.96
207 2016-01-03T19:3 70 orzo dry_goods 0.19
207 2016-01-03T19:3 41 frozen_tamales frozen 1.09
207 2016-01-03T19:3 84 buckwheat_flour dry_goods 2.59
209 2016-01-06T19:3 14 falafel_chips snacks 0.53
209 2016-01-06T19:3 26 green_juice beverages 0.25
209 2016-01-06T19:3 36 olive_tapanade canned_jarred_ 1.12
210 2016-01-07T11:3 11 pineberry produce 4.89
210 2016-01-07T11:3 83 soy_ginger_trail_snacks 0.39
210 2016-01-07T11:3 82 mango_black_teadry_goods 3.08
211 2016-01-05T13:5 45 butter_chicken frozen 1.29
211 2016-01-05T13:5 68 salmonberries produce 0.67
211 2016-01-05T13:5 23 pine_nuts dry_goods 0.91
212 2016-01-05T11:2 60 satsuma_orangesproduce 2.06
213 2016-01-04T08:0 70 orzo dry_goods 0.19
213 2016-01-04T08:0 4 clementines produce 1.19
213 2016-01-04T08:0 22 smoked_trout meat 19.59
214 2016-01-03T15:2 13 asparagus_water beverages 0.38
214 2016-01-03T15:2 40 vegetable_gyoza frozen 1.17
214 2016-01-03T15:2 60 satsuma_orangesproduce 2.06
214 2016-01-03T15:2 41 frozen_tamales frozen 1.09
215 2016-01-04T15:1 33 white_bean_and canned_jarred_ 0.97
215 2016-01-04T15:1 56 organic_glazed_wdry_goods 0.86
216 2016-01-05T18:5 72 wild_rice dry_goods 0.27
216 2016-01-05T18:5 32 arugula produce 2.99
216 2016-01-05T18:5 27 celery_foam other 6
216 2016-01-05T18:5 40 vegetable_gyoza frozen 1.17
216 2016-01-05T18:5 36 olive_tapanade canned_jarred_ 1.12
217 2016-01-04T13:4 12 vegan_egg_substidairy 1.15
217 2016-01-04T13:4 52 cranberry_infuse dairy 1.79
217 2016-01-04T13:4 52 cranberry_infuse dairy 1.79
218 2016-01-08T19:2 33 white_bean_and canned_jarred_ 0.97
218 2016-01-08T19:2 45 butter_chicken frozen 1.29
220 2016-01-03T16:0 14 falafel_chips snacks 0.53
220 2016-01-03T16:0 2 apple_fuji produce 1.44
221 2016-01-04T14:2 15 sweet_potato_hosnacks 0.43
221 2016-01-04T14:2 84 buckwheat_flour dry_goods 2.59
221 2016-01-04T14:2 77 sugar_snap_peasproduce 2.67
222 2016-01-03T13:2 41 frozen_tamales frozen 1.09
224 2016-01-06T17:5 8 pluot produce 3.99
224 2016-01-06T17:5 36 olive_tapanade canned_jarred_ 1.12
224 2016-01-06T17:5 16 arugula_crisps snacks 2.43
225 2016-01-06T18:5 65 purple_onions produce 1.32
226 2016-01-07T17:1 32 arugula produce 2.99
226 2016-01-07T17:1 54 aged_gouda dairy 1.23
226 2016-01-07T17:1 52 cranberry_infuse dairy 1.79
226 2016-01-07T17:1 40 vegetable_gyoza frozen 1.17
227 2016-01-03T08:0 20 sriracha_popcornsnacks 1.11
228 2016-01-06T09:5 12 vegan_egg_substidairy 1.15
229 2016-01-06T13:3 68 salmonberries produce 0.67
229 2016-01-06T13:3 19 all_natural_chee snacks 0.41
229 2016-01-06T13:3 26 green_juice beverages 0.25
229 2016-01-06T13:3 70 orzo dry_goods 0.19
229 2016-01-06T13:3 16 arugula_crisps snacks 2.43
229 2016-01-06T13:3 79 darjeeling_black_dry_goods 3.3
229 2016-01-06T13:3 15 sweet_potato_hosnacks 0.43
231 2016-01-07T16:4 38 pork_gyoza frozen 1.19
231 2016-01-07T16:4 61 grapefruits produce 0.55
232 2016-01-06T16:5 32 arugula produce 2.99
232 2016-01-06T16:5 8 pluot produce 3.99
232 2016-01-06T16:5 41 frozen_tamales frozen 1.09
233 2016-01-08T10:1 10 pomello produce 0.96
233 2016-01-08T10:1 28 protein_powder dry_goods 0.69
235 2016-01-05T12:0 32 arugula produce 2.99
235 2016-01-05T12:0 22 smoked_trout meat 19.59
235 2016-01-05T12:0 41 frozen_tamales frozen 1.09
235 2016-01-05T12:0 21 buttermilk_pancasnacks 2.59
236 2016-01-04T15:4 78 garam_masala dry_goods 1.44
236 2016-01-04T15:4 55 parmigiano_reggidairy 1.1
236 2016-01-04T15:4 11 pineberry produce 4.89
236 2016-01-04T15:4 32 arugula produce 2.99
237 2016-01-04T19:5 47 paneer dairy 1.17
237 2016-01-04T19:5 20 sriracha_popcornsnacks 1.11
238 2016-01-07T09:1 66 yellow_onions produce 1.12
238 2016-01-07T09:1 40 vegetable_gyoza frozen 1.17
239 2016-01-05T13:0 36 olive_tapanade canned_jarred_ 1.12
239 2016-01-05T13:0 9 tangelo produce 0.96
239 2016-01-05T13:0 66 yellow_onions produce 1.12
239 2016-01-05T13:0 17 bottled_organic_aother 2.67
240 2016-01-03T18:1 42 porchini_mushroproduce 5.99
240 2016-01-03T18:1 17 bottled_organic_aother 2.67
240 2016-01-03T18:1 52 cranberry_infuse dairy 1.79
240 2016-01-03T18:1 59 medjool_dates produce 4.29
240 2016-01-03T18:1 66 yellow_onions produce 1.12
242 2016-01-04T11:3 82 mango_black_teadry_goods 3.08
242 2016-01-04T11:3 1 strawberry produce 3.28
243 2016-01-03T09:0 12 vegan_egg_substidairy 1.15
243 2016-01-03T09:0 79 darjeeling_black_dry_goods 3.3
243 2016-01-03T09:0 1 strawberry produce 3.28
243 2016-01-03T09:0 11 pineberry produce 4.89
244 2016-01-07T17:2 70 orzo dry_goods 0.19
244 2016-01-07T17:2 43 garlic_naan bread 0.99
245 2016-01-06T08:5 26 green_juice beverages 0.25
245 2016-01-06T08:5 72 wild_rice dry_goods 0.27
245 2016-01-06T08:5 78 garam_masala dry_goods 1.44
245 2016-01-06T08:5 16 arugula_crisps snacks 2.43
245 2016-01-06T08:5 9 tangelo produce 0.96
245 2016-01-06T08:5 83 soy_ginger_trail_snacks 0.39
246 2016-01-07T19:1 8 pluot produce 3.99
246 2016-01-07T19:1 43 garlic_naan bread 0.99
247 2016-01-07T14:3 55 parmigiano_reggidairy 1.1
247 2016-01-07T14:3 46 frozen_salmon frozen 16.99
249 2016-01-06T14:2 80 rooibos_tea dry_goods 3.49
249 2016-01-06T14:2 53 black_pepper_godairy 1.69
249 2016-01-06T14:2 45 butter_chicken frozen 1.29
249 2016-01-06T14:2 23 pine_nuts dry_goods 0.91
250 2016-01-05T15:0 52 cranberry_infuse dairy 1.79
250 2016-01-05T15:0 57 Kumatos produce 3.6
251 2016-01-04T08:0 7 tayberry produce 2.54
251 2016-01-04T08:0 17 bottled_organic_aother 2.67
252 2016-01-04T10:1 64 white_onions produce 1.22
252 2016-01-04T10:1 80 rooibos_tea dry_goods 3.49
253 2016-01-06T14:1 41 frozen_tamales frozen 1.09
253 2016-01-06T14:1 74 poppy_onion_sessnacks 0.75
253 2016-01-06T14:1 7 tayberry produce 2.54
254 2016-01-04T13:5 72 wild_rice dry_goods 0.27
254 2016-01-04T13:5 3 orange produce 1.02
254 2016-01-04T13:5 77 sugar_snap_peasproduce 2.67
254 2016-01-04T13:5 60 satsuma_orangesproduce 2.06
255 2016-01-08T18:0 26 green_juice beverages 0.25
256 2016-01-03T14:1 54 aged_gouda dairy 1.23
256 2016-01-03T14:1 84 buckwheat_flour dry_goods 2.59
258 2016-01-04T15:2 39 table_wafers snacks 0.59
258 2016-01-04T15:2 26 green_juice beverages 0.25
258 2016-01-04T15:2 65 purple_onions produce 1.32
258 2016-01-04T15:2 2 apple_fuji produce 1.44
258 2016-01-04T15:2 39 table_wafers snacks 0.59
259 2016-01-08T18:0 64 white_onions produce 1.22
259 2016-01-08T18:0 12 vegan_egg_substidairy 1.15
259 2016-01-08T18:0 64 white_onions produce 1.22
259 2016-01-08T18:0 30 camembert_cheedairy 0.91
260 2016-01-08T11:5 84 buckwheat_flour dry_goods 2.59
260 2016-01-08T11:5 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 appropria
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-9
VLOOKUP accomplishes the goal of taking data from one dataset and joining it onto the n
Imagine there were two rows in the lookup table for which the 'product_id' was equal to
particular dataset, but there are many instances in which you might perform a "many to m
in this worksheet. The formula in that cell takes the product_id (in this case, 3), looks it up
the product name. If there are two products with the same ID, which name should it retu
produce value, but that may not always be correct. And when that's not the behavior you'd like, Ex
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 instead-vlookup). Unfortunately, neither of these address the underlying problem that so
create new rows.
The lookup functions also slow down Excel a lot. If you're working with hundreds of thous
downright unusable.
produce For starters, SQL can do 1:1, 1:many, and many:many joins. Moreover, SQL is smart enoug
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
—without any change in the code you write. In other words, SQL much more gracefully h
data.
produce In order to get more robust with VLOOKUP, you have to add more functions into the mix (
produce above), which complicates things and doesn't solve a lot of the problems inherent in VLOO
and can get very messy quickly.
produce In this worksheet, we're using a simple example for which the correct results can be obtai
a table containing transactions and we're joining two columns from another table: 'produ
Each row only has one 'product_id', so VLOOKUP will correctly find the entry from the oth
Fortunately, 'product_id' is unique in the other table —no two products have the same ID
sense. In other words, this is a join that is actually possible in Excel. There are many other
(even easy) in SQL that are impossible to do in Excel without VBA programming. We're jus
how the two applications work on the same problem.
SQL can also incorporate conditional statements into joins, so that only a portion of eithe
Excel can do this too, but it requires at least one IF statement, and a few extra VLOOKUPs,
more and are really tough to reason about. In SQL, it's really, really easy. To illustrate this,
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 ou
particularly powerful feature of SQL.
Compare the output in the "Report" section here to that in the above query and check ou
produce particularly powerful feature of SQL.
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
el joins data from one table to another. There's a bit of flexibility in
is also in row 2 (in this case, it's 'product_id'). That identifier is then
t VLOOKUP tab) and pull the appropriate value.
w it works and want more info, we suggest you check it out here:
-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
m one dataset and joining it onto the next, but it has a few problems.
r which the 'product_id' was equal to 3. It's not the case with this
which you might perform a "many to many" join. Now consider cell D2
product_id (in this case, 3), looks it up in the other table, and returns
he same ID, which name should it return? Excel defaults to the first
n that's not the behavior you'd like, Excel doesn't really give you much
which the correct results can be obtained in Excel. We're starting with
wo columns from another table: 'product_name' and 'product_type'.
ill correctly find the entry from the other table with that 'product_id'.
e —no two products have the same ID—so this joining logic makes
ossible in Excel. There are many other types of joins that are possible
l without VBA programming. We're just doing this easy one to compare
m.
ytics.com/tutorial/reports/6f71eb9a898b/queries/4e331243df46
QL:
edc4807/queries/70371e75873e
o that in the above query and check out the difference. This is a
/join-intro/
o joins, so that only a portion of either table is included in the join.
statement, and a few extra VLOOKUPs, which slow down the file even
it's really, really easy. To illustrate this, we've added a
roduct type if the value should be "produce." You can see in the
QL:
edc4807/queries/70371e75873e
o that in the above query and check out the difference. This is a
/join-intro/
transaction_id time product_id product_name product_type price/unit
1 2016-01-08T1 3 orange produce 1.02
1 2016-01-08T1 61 grapefruits produce 0.55
2 2016-01-07T1 23 pine_nuts dry_goods 0.91
4 2016-01-06T1 52 cranberry_infuse dairy 1.79
4 2016-01-06T1 4 clementines produce 1.19
4 2016-01-06T1 76 cheddar_whales snacks 0.69
5 2016-01-07T1 45 butter_chicken frozen 1.29
7 2016-01-07T1 17 bottled_organic_aother 2.67
7 2016-01-07T1 31 almond_nut_thinsnacks 0.61
7 2016-01-07T1 21 buttermilk_pancasnacks 2.59
7 2016-01-07T1 47 paneer dairy 1.17
7 2016-01-07T1 44 frozen_clams frozen 4.99
8 2016-01-07T0 8 pluot produce 3.99
8 2016-01-07T0 60 satsuma_orangesproduce 2.06
8 2016-01-07T0 38 pork_gyoza frozen 1.19
8 2016-01-07T0 64 white_onions produce 1.22
9 2016-01-03T0 12 vegan_egg_substidairy 1.15
9 2016-01-03T0 14 falafel_chips snacks 0.53
9 2016-01-03T0 17 bottled_organic_aother 2.67
9 2016-01-03T0 70 orzo dry_goods 0.19
9 2016-01-03T0 10 pomello produce 0.96
10 2016-01-04T0 18 chia_seeds dry_goods 0.67
11 2016-01-08T1 77 sugar_snap_peasproduce 2.67
11 2016-01-08T1 25 smoked_salmon meat 39.99
11 2016-01-08T1 47 paneer dairy 1.17
11 2016-01-08T1 36 olive_tapanade canned_jarred_ 1.12
11 2016-01-08T1 10 pomello produce 0.96
12 2016-01-04T1 66 yellow_onions produce 1.12
13 2016-01-04T1 21 buttermilk_pancasnacks 2.59
15 2016-01-05T0 42 porchini_mushroproduce 5.99
15 2016-01-05T0 56 organic_glazed_wdry_goods 0.86
15 2016-01-05T0 29 asiago_cheese dairy 0.63
16 2016-01-05T1 36 olive_tapanade canned_jarred_ 1.12
16 2016-01-05T1 41 frozen_tamales frozen 1.09
16 2016-01-05T1 22 smoked_trout meat 19.59
17 2016-01-07T1 73 cheddar_corn_stisnacks 0.69
17 2016-01-07T1 41 frozen_tamales frozen 1.09
19 2016-01-04T1 76 cheddar_whales snacks 0.69
19 2016-01-04T1 71 autumn_pilaf dry_goods 0.24
20 2016-01-04T1 6 blood_lime produce 1.69
20 2016-01-04T1 6 blood_lime produce 1.69
20 2016-01-04T1 29 asiago_cheese dairy 0.63
20 2016-01-04T1 10 pomello produce 0.96
21 2016-01-05T0 47 paneer dairy 1.17
21 2016-01-05T0 68 salmonberries produce 0.67
21 2016-01-05T0 52 cranberry_infuse dairy 1.79
21 2016-01-05T0 41 frozen_tamales frozen 1.09
22 2016-01-06T1 14 falafel_chips snacks 0.53
22 2016-01-06T1 27 celery_foam other 6
23 2016-01-07T0 67 barberries dry_goods 1.74
23 2016-01-07T0 13 asparagus_water beverages 0.38
23 2016-01-07T0 55 parmigiano_reggidairy 1.1
23 2016-01-07T0 69 wholewheat_cousdry_goods 0.27
24 2016-01-03T1 54 aged_gouda dairy 1.23
24 2016-01-03T1 3 orange produce 1.02
25 2016-01-06T1 83 soy_ginger_trail_snacks 0.39
26 2016-01-06T0 26 green_juice beverages 0.25
26 2016-01-06T0 22 smoked_trout meat 19.59
26 2016-01-06T0 5 blood_orange produce 3.86
26 2016-01-06T0 32 arugula produce 2.99
26 2016-01-06T0 47 paneer dairy 1.17
27 2016-01-07T1 51 english_cheddar dairy 0.89
27 2016-01-07T1 40 vegetable_gyoza frozen 1.17
27 2016-01-07T1 48 organic_mung_bedry_goods 0.89
29 2016-01-07T1 28 protein_powder dry_goods 0.69
30 2016-01-05T1 68 salmonberries produce 0.67
31 2016-01-05T1 3 orange produce 1.02
32 2016-01-04T1 65 purple_onions produce 1.32
32 2016-01-04T1 7 tayberry produce 2.54
32 2016-01-04T1 67 barberries dry_goods 1.74
32 2016-01-04T1 7 tayberry produce 2.54
32 2016-01-04T1 3 orange produce 1.02
33 2016-01-03T1 72 wild_rice dry_goods 0.27
34 2016-01-08T1 84 buckwheat_flour dry_goods 2.59
35 2016-01-05T1 65 purple_onions produce 1.32
35 2016-01-05T1 14 falafel_chips snacks 0.53
35 2016-01-05T1 44 frozen_clams frozen 4.99
36 2016-01-07T1 59 medjool_dates produce 4.29
36 2016-01-07T1 63 organic_garlic produce 3.57
37 2016-01-06T1 52 cranberry_infuse dairy 1.79
37 2016-01-06T1 19 all_natural_chee snacks 0.41
37 2016-01-06T1 8 pluot produce 3.99
38 2016-01-06T1 69 wholewheat_cousdry_goods 0.27
39 2016-01-08T1 66 yellow_onions produce 1.12
39 2016-01-08T1 24 dried_apricots dry_goods 0.56
40 2016-01-03T1 7 tayberry produce 2.54
40 2016-01-03T1 1 strawberry produce 3.28
40 2016-01-03T1 17 bottled_organic_aother 2.67
41 2016-01-05T1 52 cranberry_infuse dairy 1.79
41 2016-01-05T1 61 grapefruits produce 0.55
41 2016-01-05T1 62 goji_berries dry_goods 1.17
42 2016-01-05T1 77 sugar_snap_peasproduce 2.67
43 2016-01-03T1 2 apple_fuji produce 1.44
43 2016-01-03T1 41 frozen_tamales frozen 1.09
44 2016-01-06T1 56 organic_glazed_wdry_goods 0.86
44 2016-01-06T1 75 rice_crackers snacks 0.57
45 2016-01-07T0 75 rice_crackers snacks 0.57
45 2016-01-07T0 40 vegetable_gyoza frozen 1.17
45 2016-01-07T0 39 table_wafers snacks 0.59
45 2016-01-07T0 51 english_cheddar dairy 0.89
45 2016-01-07T0 52 cranberry_infuse dairy 1.79
46 2016-01-03T0 63 organic_garlic produce 3.57
46 2016-01-03T0 43 garlic_naan bread 0.99
47 2016-01-07T1 28 protein_powder dry_goods 0.69
48 2016-01-08T1 30 camembert_cheedairy 0.91
48 2016-01-08T1 23 pine_nuts dry_goods 0.91
48 2016-01-08T1 18 chia_seeds dry_goods 0.67
48 2016-01-08T1 20 sriracha_popcornsnacks 1.11
49 2016-01-07T1 67 barberries dry_goods 1.74
49 2016-01-07T1 53 black_pepper_godairy 1.69
50 2016-01-06T1 56 organic_glazed_wdry_goods 0.86
50 2016-01-06T1 80 rooibos_tea dry_goods 3.49
52 2016-01-05T1 50 white_cheddar dairy 0.77
52 2016-01-05T1 13 asparagus_water beverages 0.38
52 2016-01-05T1 44 frozen_clams frozen 4.99
53 2016-01-06T1 61 grapefruits produce 0.55
53 2016-01-06T1 33 white_bean_and canned_jarred_ 0.97
53 2016-01-06T1 36 olive_tapanade canned_jarred_ 1.12
53 2016-01-06T1 29 asiago_cheese dairy 0.63
54 2016-01-03T0 20 sriracha_popcornsnacks 1.11
54 2016-01-03T0 79 darjeeling_black_dry_goods 3.3
55 2016-01-05T1 8 pluot produce 3.99
55 2016-01-05T1 76 cheddar_whales snacks 0.69
56 2016-01-03T1 62 goji_berries dry_goods 1.17
56 2016-01-03T1 70 orzo dry_goods 0.19
57 2016-01-07T1 81 irish_breakfast_bdry_goods 2.99
57 2016-01-07T1 64 white_onions produce 1.22
57 2016-01-07T1 11 pineberry produce 4.89
58 2016-01-08T0 79 darjeeling_black_dry_goods 3.3
58 2016-01-08T0 37 chocolate_ganachfrozen 3.52
58 2016-01-08T0 39 table_wafers snacks 0.59
58 2016-01-08T0 27 celery_foam other 6
59 2016-01-08T1 4 clementines produce 1.19
60 2016-01-03T1 51 english_cheddar dairy 0.89
60 2016-01-03T1 13 asparagus_water beverages 0.38
60 2016-01-03T1 78 garam_masala dry_goods 1.44
61 2016-01-03T0 22 smoked_trout meat 19.59
61 2016-01-03T0 31 almond_nut_thinsnacks 0.61
61 2016-01-03T0 46 frozen_salmon frozen 16.99
61 2016-01-03T0 46 frozen_salmon frozen 16.99
62 2016-01-07T1 56 organic_glazed_wdry_goods 0.86
63 2016-01-06T1 16 arugula_crisps snacks 2.43
64 2016-01-06T1 16 arugula_crisps snacks 2.43
64 2016-01-06T1 70 orzo dry_goods 0.19
64 2016-01-06T1 22 smoked_trout meat 19.59
65 2016-01-07T1 50 white_cheddar dairy 0.77
65 2016-01-07T1 29 asiago_cheese dairy 0.63
65 2016-01-07T1 58 pumpkin_spice_pdry_goods 0.96
66 2016-01-08T1 39 table_wafers snacks 0.59
67 2016-01-04T1 55 parmigiano_reggidairy 1.1
67 2016-01-04T1 49 silken_tofu dairy 0.67
67 2016-01-04T1 67 barberries dry_goods 1.74
68 2016-01-03T1 36 olive_tapanade canned_jarred_ 1.12
69 2016-01-05T0 82 mango_black_teadry_goods 3.08
69 2016-01-05T0 55 parmigiano_reggidairy 1.1
69 2016-01-05T0 60 satsuma_orangesproduce 2.06
69 2016-01-05T0 62 goji_berries dry_goods 1.17
70 2016-01-06T1 21 buttermilk_pancasnacks 2.59
70 2016-01-06T1 81 irish_breakfast_bdry_goods 2.99
70 2016-01-06T1 56 organic_glazed_wdry_goods 0.86
71 2016-01-04T1 74 poppy_onion_sessnacks 0.75
72 2016-01-06T1 30 camembert_cheedairy 0.91
72 2016-01-06T1 19 all_natural_chee snacks 0.41
72 2016-01-06T1 67 barberries dry_goods 1.74
72 2016-01-06T1 42 porchini_mushroproduce 5.99
73 2016-01-07T1 81 irish_breakfast_bdry_goods 2.99
73 2016-01-07T1 24 dried_apricots dry_goods 0.56
73 2016-01-07T1 20 sriracha_popcornsnacks 1.11
74 2016-01-07T1 21 buttermilk_pancasnacks 2.59
74 2016-01-07T1 36 olive_tapanade canned_jarred_ 1.12
75 2016-01-04T1 11 pineberry produce 4.89
75 2016-01-04T1 72 wild_rice dry_goods 0.27
76 2016-01-06T1 57 Kumatos produce 3.6
76 2016-01-06T1 73 cheddar_corn_stisnacks 0.69
77 2016-01-06T1 28 protein_powder dry_goods 0.69
78 2016-01-06T0 76 cheddar_whales snacks 0.69
78 2016-01-06T0 25 smoked_salmon meat 39.99
78 2016-01-06T0 2 apple_fuji produce 1.44
78 2016-01-06T0 12 vegan_egg_substidairy 1.15
79 2016-01-05T1 9 tangelo produce 0.96
79 2016-01-05T1 10 pomello produce 0.96
79 2016-01-05T1 16 arugula_crisps snacks 2.43
81 2016-01-03T0 65 purple_onions produce 1.32
82 2016-01-04T1 17 bottled_organic_aother 2.67
82 2016-01-04T1 20 sriracha_popcornsnacks 1.11
82 2016-01-04T1 14 falafel_chips snacks 0.53
82 2016-01-04T1 27 celery_foam other 6
83 2016-01-08T1 60 satsuma_orangesproduce 2.06
84 2016-01-08T1 67 barberries dry_goods 1.74
84 2016-01-08T1 77 sugar_snap_peasproduce 2.67
85 2016-01-07T1 79 darjeeling_black_dry_goods 3.3
85 2016-01-07T1 81 irish_breakfast_bdry_goods 2.99
86 2016-01-07T0 9 tangelo produce 0.96
86 2016-01-07T0 42 porchini_mushroproduce 5.99
86 2016-01-07T0 69 wholewheat_cousdry_goods 0.27
86 2016-01-07T0 76 cheddar_whales snacks 0.69
87 2016-01-05T1 63 organic_garlic produce 3.57
87 2016-01-05T1 78 garam_masala dry_goods 1.44
88 2016-01-04T1 82 mango_black_teadry_goods 3.08
88 2016-01-04T1 69 wholewheat_cousdry_goods 0.27
88 2016-01-04T1 81 irish_breakfast_bdry_goods 2.99
88 2016-01-04T1 78 garam_masala dry_goods 1.44
88 2016-01-04T1 80 rooibos_tea dry_goods 3.49
89 2016-01-06T1 58 pumpkin_spice_pdry_goods 0.96
90 2016-01-05T0 57 Kumatos produce 3.6
90 2016-01-05T0 19 all_natural_chee snacks 0.41
91 2016-01-07T1 26 green_juice beverages 0.25
91 2016-01-07T1 13 asparagus_water beverages 0.38
91 2016-01-07T1 2 apple_fuji produce 1.44
91 2016-01-07T1 35 eggplant_caponatfrozen 1.39
92 2016-01-08T1 6 blood_lime produce 1.69
93 2016-01-04T1 23 pine_nuts dry_goods 0.91
93 2016-01-04T1 46 frozen_salmon frozen 16.99
93 2016-01-04T1 21 buttermilk_pancasnacks 2.59
94 2016-01-04T1 11 pineberry produce 4.89
94 2016-01-04T1 64 white_onions produce 1.22
95 2016-01-08T1 15 sweet_potato_hosnacks 0.43
96 2016-01-04T1 76 cheddar_whales snacks 0.69
97 2016-01-08T1 7 tayberry produce 2.54
97 2016-01-08T1 40 vegetable_gyoza frozen 1.17
97 2016-01-08T1 38 pork_gyoza frozen 1.19
97 2016-01-08T1 36 olive_tapanade canned_jarred_ 1.12
98 2016-01-04T1 75 rice_crackers snacks 0.57
98 2016-01-04T1 35 eggplant_caponatfrozen 1.39
99 2016-01-06T1 15 sweet_potato_hosnacks 0.43
99 2016-01-06T1 40 vegetable_gyoza frozen 1.17
100 2016-01-05T1 78 garam_masala dry_goods 1.44
100 2016-01-05T1 2 apple_fuji produce 1.44
100 2016-01-05T1 64 white_onions produce 1.22
100 2016-01-05T1 13 asparagus_water beverages 0.38
101 2016-01-04T1 78 garam_masala dry_goods 1.44
101 2016-01-04T1 48 organic_mung_bedry_goods 0.89
101 2016-01-04T1 17 bottled_organic_aother 2.67
101 2016-01-04T1 15 sweet_potato_hosnacks 0.43
102 2016-01-04T1 48 organic_mung_bedry_goods 0.89
102 2016-01-04T1 39 table_wafers snacks 0.59
102 2016-01-04T1 35 eggplant_caponatfrozen 1.39
103 2016-01-05T1 57 Kumatos produce 3.6
103 2016-01-05T1 72 wild_rice dry_goods 0.27
103 2016-01-05T1 51 english_cheddar dairy 0.89
104 2016-01-08T0 75 rice_crackers snacks 0.57
104 2016-01-08T0 42 porchini_mushroproduce 5.99
104 2016-01-08T0 17 bottled_organic_aother 2.67
105 2016-01-08T1 81 irish_breakfast_bdry_goods 2.99
105 2016-01-08T1 24 dried_apricots dry_goods 0.56
105 2016-01-08T1 57 Kumatos produce 3.6
106 2016-01-03T0 57 Kumatos produce 3.6
106 2016-01-03T0 46 frozen_salmon frozen 16.99
106 2016-01-03T0 38 pork_gyoza frozen 1.19
106 2016-01-03T0 36 olive_tapanade canned_jarred_ 1.12
106 2016-01-03T0 34 edamame_hummcanned_jarred_ 0.95
106 2016-01-03T0 60 satsuma_orangesproduce 2.06
107 2016-01-08T1 12 vegan_egg_substidairy 1.15
108 2016-01-04T1 5 blood_orange produce 3.86
108 2016-01-04T1 27 celery_foam other 6
108 2016-01-04T1 25 smoked_salmon meat 39.99
109 2016-01-06T1 78 garam_masala dry_goods 1.44
109 2016-01-06T1 37 chocolate_ganachfrozen 3.52
109 2016-01-06T1 59 medjool_dates produce 4.29
110 2016-01-08T1 70 orzo dry_goods 0.19
111 2016-01-05T1 46 frozen_salmon frozen 16.99
112 2016-01-07T1 11 pineberry produce 4.89
112 2016-01-07T1 72 wild_rice dry_goods 0.27
113 2016-01-08T1 65 purple_onions produce 1.32
113 2016-01-08T1 27 celery_foam other 6
114 2016-01-05T1 77 sugar_snap_peasproduce 2.67
114 2016-01-05T1 13 asparagus_water beverages 0.38
116 2016-01-05T1 11 pineberry produce 4.89
116 2016-01-05T1 37 chocolate_ganachfrozen 3.52
117 2016-01-05T1 9 tangelo produce 0.96
118 2016-01-06T1 23 pine_nuts dry_goods 0.91
118 2016-01-06T1 40 vegetable_gyoza frozen 1.17
118 2016-01-06T1 75 rice_crackers snacks 0.57
118 2016-01-06T1 8 pluot produce 3.99
118 2016-01-06T1 18 chia_seeds dry_goods 0.67
118 2016-01-06T1 48 organic_mung_bedry_goods 0.89
119 2016-01-03T1 76 cheddar_whales snacks 0.69
120 2016-01-03T1 53 black_pepper_godairy 1.69
120 2016-01-03T1 63 organic_garlic produce 3.57
120 2016-01-03T1 7 tayberry produce 2.54
121 2016-01-08T1 32 arugula produce 2.99
121 2016-01-08T1 20 sriracha_popcornsnacks 1.11
121 2016-01-08T1 63 organic_garlic produce 3.57
121 2016-01-08T1 27 celery_foam other 6
123 2016-01-08T1 49 silken_tofu dairy 0.67
123 2016-01-08T1 58 pumpkin_spice_pdry_goods 0.96
123 2016-01-08T1 19 all_natural_chee snacks 0.41
124 2016-01-03T0 83 soy_ginger_trail_snacks 0.39
124 2016-01-03T0 44 frozen_clams frozen 4.99
126 2016-01-03T1 4 clementines produce 1.19
127 2016-01-04T0 40 vegetable_gyoza frozen 1.17
127 2016-01-04T0 5 blood_orange produce 3.86
128 2016-01-03T1 36 olive_tapanade canned_jarred_ 1.12
128 2016-01-03T1 15 sweet_potato_hosnacks 0.43
129 2016-01-06T1 21 buttermilk_pancasnacks 2.59
129 2016-01-06T1 55 parmigiano_reggidairy 1.1
130 2016-01-06T1 71 autumn_pilaf dry_goods 0.24
130 2016-01-06T1 55 parmigiano_reggidairy 1.1
131 2016-01-06T1 4 clementines produce 1.19
133 2016-01-07T1 59 medjool_dates produce 4.29
133 2016-01-07T1 72 wild_rice dry_goods 0.27
134 2016-01-04T1 33 white_bean_and canned_jarred_ 0.97
134 2016-01-04T1 49 silken_tofu dairy 0.67
134 2016-01-04T1 69 wholewheat_cousdry_goods 0.27
135 2016-01-03T1 15 sweet_potato_hosnacks 0.43
135 2016-01-03T1 11 pineberry produce 4.89
136 2016-01-06T1 73 cheddar_corn_stisnacks 0.69
136 2016-01-06T1 27 celery_foam other 6
136 2016-01-06T1 10 pomello produce 0.96
137 2016-01-03T1 39 table_wafers snacks 0.59
137 2016-01-03T1 84 buckwheat_flour dry_goods 2.59
138 2016-01-08T1 13 asparagus_water beverages 0.38
138 2016-01-08T1 55 parmigiano_reggidairy 1.1
138 2016-01-08T1 40 vegetable_gyoza frozen 1.17
138 2016-01-08T1 5 blood_orange produce 3.86
139 2016-01-03T1 54 aged_gouda dairy 1.23
139 2016-01-03T1 69 wholewheat_cousdry_goods 0.27
139 2016-01-03T1 2 apple_fuji produce 1.44
139 2016-01-03T1 31 almond_nut_thinsnacks 0.61
142 2016-01-06T1 73 cheddar_corn_stisnacks 0.69
142 2016-01-06T1 31 almond_nut_thinsnacks 0.61
142 2016-01-06T1 24 dried_apricots dry_goods 0.56
143 2016-01-06T0 73 cheddar_corn_stisnacks 0.69
143 2016-01-06T0 77 sugar_snap_peasproduce 2.67
143 2016-01-06T0 84 buckwheat_flour dry_goods 2.59
144 2016-01-05T1 46 frozen_salmon frozen 16.99
145 2016-01-05T1 52 cranberry_infuse dairy 1.79
145 2016-01-05T1 79 darjeeling_black_dry_goods 3.3
146 2016-01-03T1 31 almond_nut_thinsnacks 0.61
147 2016-01-08T1 52 cranberry_infuse dairy 1.79
147 2016-01-08T1 39 table_wafers snacks 0.59
147 2016-01-08T1 58 pumpkin_spice_pdry_goods 0.96
148 2016-01-03T1 15 sweet_potato_hosnacks 0.43
149 2016-01-08T1 71 autumn_pilaf dry_goods 0.24
149 2016-01-08T1 54 aged_gouda dairy 1.23
151 2016-01-06T1 9 tangelo produce 0.96
151 2016-01-06T1 12 vegan_egg_substidairy 1.15
151 2016-01-06T1 13 asparagus_water beverages 0.38
152 2016-01-03T1 84 buckwheat_flour dry_goods 2.59
152 2016-01-03T1 65 purple_onions produce 1.32
153 2016-01-06T0 1 strawberry produce 3.28
153 2016-01-06T0 56 organic_glazed_wdry_goods 0.86
154 2016-01-06T1 54 aged_gouda dairy 1.23
154 2016-01-06T1 64 white_onions produce 1.22
155 2016-01-07T1 12 vegan_egg_substidairy 1.15
155 2016-01-07T1 69 wholewheat_cousdry_goods 0.27
156 2016-01-06T1 37 chocolate_ganachfrozen 3.52
157 2016-01-04T1 8 pluot produce 3.99
157 2016-01-04T1 8 pluot produce 3.99
157 2016-01-04T1 61 grapefruits produce 0.55
158 2016-01-08T1 9 tangelo produce 0.96
158 2016-01-08T1 29 asiago_cheese dairy 0.63
158 2016-01-08T1 72 wild_rice dry_goods 0.27
158 2016-01-08T1 54 aged_gouda dairy 1.23
158 2016-01-08T1 47 paneer dairy 1.17
159 2016-01-04T1 77 sugar_snap_peasproduce 2.67
159 2016-01-04T1 25 smoked_salmon meat 39.99
159 2016-01-04T1 78 garam_masala dry_goods 1.44
160 2016-01-04T1 1 strawberry produce 3.28
160 2016-01-04T1 13 asparagus_water beverages 0.38
160 2016-01-04T1 32 arugula produce 2.99
161 2016-01-03T1 40 vegetable_gyoza frozen 1.17
162 2016-01-05T1 55 parmigiano_reggidairy 1.1
162 2016-01-05T1 61 grapefruits produce 0.55
163 2016-01-03T1 3 orange produce 1.02
163 2016-01-03T1 6 blood_lime produce 1.69
163 2016-01-03T1 62 goji_berries dry_goods 1.17
163 2016-01-03T1 26 green_juice beverages 0.25
163 2016-01-03T1 51 english_cheddar dairy 0.89
163 2016-01-03T1 60 satsuma_orangesproduce 2.06
164 2016-01-06T1 2 apple_fuji produce 1.44
164 2016-01-06T1 31 almond_nut_thinsnacks 0.61
164 2016-01-06T1 58 pumpkin_spice_pdry_goods 0.96
165 2016-01-03T1 28 protein_powder dry_goods 0.69
165 2016-01-03T1 57 Kumatos produce 3.6
166 2016-01-04T1 63 organic_garlic produce 3.57
166 2016-01-04T1 70 orzo dry_goods 0.19
167 2016-01-05T1 79 darjeeling_black_dry_goods 3.3
168 2016-01-06T1 39 table_wafers snacks 0.59
168 2016-01-06T1 65 purple_onions produce 1.32
169 2016-01-06T0 37 chocolate_ganachfrozen 3.52
169 2016-01-06T0 44 frozen_clams frozen 4.99
170 2016-01-04T1 2 apple_fuji produce 1.44
170 2016-01-04T1 74 poppy_onion_sessnacks 0.75
170 2016-01-04T1 9 tangelo produce 0.96
171 2016-01-08T1 78 garam_masala dry_goods 1.44
171 2016-01-08T1 43 garlic_naan bread 0.99
171 2016-01-08T1 18 chia_seeds dry_goods 0.67
172 2016-01-08T0 46 frozen_salmon frozen 16.99
172 2016-01-08T0 82 mango_black_teadry_goods 3.08
173 2016-01-05T0 42 porchini_mushroproduce 5.99
173 2016-01-05T0 59 medjool_dates produce 4.29
173 2016-01-05T0 71 autumn_pilaf dry_goods 0.24
174 2016-01-04T1 56 organic_glazed_wdry_goods 0.86
174 2016-01-04T1 49 silken_tofu dairy 0.67
174 2016-01-04T1 30 camembert_cheedairy 0.91
175 2016-01-03T1 15 sweet_potato_hosnacks 0.43
175 2016-01-03T1 48 organic_mung_bedry_goods 0.89
175 2016-01-03T1 79 darjeeling_black_dry_goods 3.3
176 2016-01-06T1 71 autumn_pilaf dry_goods 0.24
176 2016-01-06T1 53 black_pepper_godairy 1.69
176 2016-01-06T1 63 organic_garlic produce 3.57
176 2016-01-06T1 77 sugar_snap_peasproduce 2.67
177 2016-01-03T1 66 yellow_onions produce 1.12
177 2016-01-03T1 44 frozen_clams frozen 4.99
177 2016-01-03T1 43 garlic_naan bread 0.99
178 2016-01-06T1 39 table_wafers snacks 0.59
178 2016-01-06T1 51 english_cheddar dairy 0.89
179 2016-01-08T1 22 smoked_trout meat 19.59
179 2016-01-08T1 36 olive_tapanade canned_jarred_ 1.12
180 2016-01-07T0 26 green_juice beverages 0.25
182 2016-01-06T1 36 olive_tapanade canned_jarred_ 1.12
182 2016-01-06T1 29 asiago_cheese dairy 0.63
182 2016-01-06T1 6 blood_lime produce 1.69
183 2016-01-05T1 16 arugula_crisps snacks 2.43
184 2016-01-08T1 6 blood_lime produce 1.69
185 2016-01-07T1 11 pineberry produce 4.89
185 2016-01-07T1 22 smoked_trout meat 19.59
186 2016-01-06T0 74 poppy_onion_sessnacks 0.75
186 2016-01-06T0 54 aged_gouda dairy 1.23
187 2016-01-08T1 16 arugula_crisps snacks 2.43
187 2016-01-08T1 23 pine_nuts dry_goods 0.91
187 2016-01-08T1 4 clementines produce 1.19
187 2016-01-08T1 69 wholewheat_cousdry_goods 0.27
188 2016-01-03T1 12 vegan_egg_substidairy 1.15
190 2016-01-08T0 27 celery_foam other 6
190 2016-01-08T0 24 dried_apricots dry_goods 0.56
190 2016-01-08T0 33 white_bean_and canned_jarred_ 0.97
190 2016-01-08T0 77 sugar_snap_peasproduce 2.67
190 2016-01-08T0 40 vegetable_gyoza frozen 1.17
191 2016-01-08T1 78 garam_masala dry_goods 1.44
191 2016-01-08T1 32 arugula produce 2.99
192 2016-01-04T1 22 smoked_trout meat 19.59
192 2016-01-04T1 73 cheddar_corn_stisnacks 0.69
193 2016-01-06T1 62 goji_berries dry_goods 1.17
193 2016-01-06T1 61 grapefruits produce 0.55
194 2016-01-08T1 54 aged_gouda dairy 1.23
194 2016-01-08T1 45 butter_chicken frozen 1.29
194 2016-01-08T1 31 almond_nut_thinsnacks 0.61
195 2016-01-07T1 65 purple_onions produce 1.32
195 2016-01-07T1 32 arugula produce 2.99
195 2016-01-07T1 34 edamame_hummcanned_jarred_ 0.95
195 2016-01-07T1 59 medjool_dates produce 4.29
196 2016-01-08T1 66 yellow_onions produce 1.12
199 2016-01-04T0 34 edamame_hummcanned_jarred_ 0.95
199 2016-01-04T0 60 satsuma_orangesproduce 2.06
200 2016-01-08T1 46 frozen_salmon frozen 16.99
201 2016-01-03T0 9 tangelo produce 0.96
201 2016-01-03T0 24 dried_apricots dry_goods 0.56
202 2016-01-07T1 81 irish_breakfast_bdry_goods 2.99
202 2016-01-07T1 80 rooibos_tea dry_goods 3.49
202 2016-01-07T1 43 garlic_naan bread 0.99
203 2016-01-08T1 67 barberries dry_goods 1.74
203 2016-01-08T1 60 satsuma_orangesproduce 2.06
203 2016-01-08T1 14 falafel_chips snacks 0.53
204 2016-01-08T1 27 celery_foam other 6
204 2016-01-08T1 41 frozen_tamales frozen 1.09
204 2016-01-08T1 22 smoked_trout meat 19.59
205 2016-01-07T1 51 english_cheddar dairy 0.89
205 2016-01-07T1 29 asiago_cheese dairy 0.63
206 2016-01-05T1 67 barberries dry_goods 1.74
207 2016-01-03T1 58 pumpkin_spice_pdry_goods 0.96
207 2016-01-03T1 70 orzo dry_goods 0.19
207 2016-01-03T1 41 frozen_tamales frozen 1.09
207 2016-01-03T1 84 buckwheat_flour dry_goods 2.59
209 2016-01-06T1 14 falafel_chips snacks 0.53
209 2016-01-06T1 26 green_juice beverages 0.25
209 2016-01-06T1 36 olive_tapanade canned_jarred_ 1.12
210 2016-01-07T1 11 pineberry produce 4.89
210 2016-01-07T1 83 soy_ginger_trail_snacks 0.39
210 2016-01-07T1 82 mango_black_teadry_goods 3.08
211 2016-01-05T1 45 butter_chicken frozen 1.29
211 2016-01-05T1 68 salmonberries produce 0.67
211 2016-01-05T1 23 pine_nuts dry_goods 0.91
212 2016-01-05T1 60 satsuma_orangesproduce 2.06
213 2016-01-04T0 70 orzo dry_goods 0.19
213 2016-01-04T0 4 clementines produce 1.19
213 2016-01-04T0 22 smoked_trout meat 19.59
214 2016-01-03T1 13 asparagus_water beverages 0.38
214 2016-01-03T1 40 vegetable_gyoza frozen 1.17
214 2016-01-03T1 60 satsuma_orangesproduce 2.06
214 2016-01-03T1 41 frozen_tamales frozen 1.09
215 2016-01-04T1 33 white_bean_and canned_jarred_ 0.97
215 2016-01-04T1 56 organic_glazed_wdry_goods 0.86
216 2016-01-05T1 72 wild_rice dry_goods 0.27
216 2016-01-05T1 32 arugula produce 2.99
216 2016-01-05T1 27 celery_foam other 6
216 2016-01-05T1 40 vegetable_gyoza frozen 1.17
216 2016-01-05T1 36 olive_tapanade canned_jarred_ 1.12
217 2016-01-04T1 12 vegan_egg_substidairy 1.15
217 2016-01-04T1 52 cranberry_infuse dairy 1.79
217 2016-01-04T1 52 cranberry_infuse dairy 1.79
218 2016-01-08T1 33 white_bean_and canned_jarred_ 0.97
218 2016-01-08T1 45 butter_chicken frozen 1.29
220 2016-01-03T1 14 falafel_chips snacks 0.53
220 2016-01-03T1 2 apple_fuji produce 1.44
221 2016-01-04T1 15 sweet_potato_hosnacks 0.43
221 2016-01-04T1 84 buckwheat_flour dry_goods 2.59
221 2016-01-04T1 77 sugar_snap_peasproduce 2.67
222 2016-01-03T1 41 frozen_tamales frozen 1.09
224 2016-01-06T1 8 pluot produce 3.99
224 2016-01-06T1 36 olive_tapanade canned_jarred_ 1.12
224 2016-01-06T1 16 arugula_crisps snacks 2.43
225 2016-01-06T1 65 purple_onions produce 1.32
226 2016-01-07T1 32 arugula produce 2.99
226 2016-01-07T1 54 aged_gouda dairy 1.23
226 2016-01-07T1 52 cranberry_infuse dairy 1.79
226 2016-01-07T1 40 vegetable_gyoza frozen 1.17
227 2016-01-03T0 20 sriracha_popcornsnacks 1.11
228 2016-01-06T0 12 vegan_egg_substidairy 1.15
229 2016-01-06T1 68 salmonberries produce 0.67
229 2016-01-06T1 19 all_natural_chee snacks 0.41
229 2016-01-06T1 26 green_juice beverages 0.25
229 2016-01-06T1 70 orzo dry_goods 0.19
229 2016-01-06T1 16 arugula_crisps snacks 2.43
229 2016-01-06T1 79 darjeeling_black_dry_goods 3.3
229 2016-01-06T1 15 sweet_potato_hosnacks 0.43
231 2016-01-07T1 38 pork_gyoza frozen 1.19
231 2016-01-07T1 61 grapefruits produce 0.55
232 2016-01-06T1 32 arugula produce 2.99
232 2016-01-06T1 8 pluot produce 3.99
232 2016-01-06T1 41 frozen_tamales frozen 1.09
233 2016-01-08T1 10 pomello produce 0.96
233 2016-01-08T1 28 protein_powder dry_goods 0.69
235 2016-01-05T1 32 arugula produce 2.99
235 2016-01-05T1 22 smoked_trout meat 19.59
235 2016-01-05T1 41 frozen_tamales frozen 1.09
235 2016-01-05T1 21 buttermilk_pancasnacks 2.59
236 2016-01-04T1 78 garam_masala dry_goods 1.44
236 2016-01-04T1 55 parmigiano_reggidairy 1.1
236 2016-01-04T1 11 pineberry produce 4.89
236 2016-01-04T1 32 arugula produce 2.99
237 2016-01-04T1 47 paneer dairy 1.17
237 2016-01-04T1 20 sriracha_popcornsnacks 1.11
238 2016-01-07T0 66 yellow_onions produce 1.12
238 2016-01-07T0 40 vegetable_gyoza frozen 1.17
239 2016-01-05T1 36 olive_tapanade canned_jarred_ 1.12
239 2016-01-05T1 9 tangelo produce 0.96
239 2016-01-05T1 66 yellow_onions produce 1.12
239 2016-01-05T1 17 bottled_organic_aother 2.67
240 2016-01-03T1 42 porchini_mushroproduce 5.99
240 2016-01-03T1 17 bottled_organic_aother 2.67
240 2016-01-03T1 52 cranberry_infuse dairy 1.79
240 2016-01-03T1 59 medjool_dates produce 4.29
240 2016-01-03T1 66 yellow_onions produce 1.12
242 2016-01-04T1 82 mango_black_teadry_goods 3.08
242 2016-01-04T1 1 strawberry produce 3.28
243 2016-01-03T0 12 vegan_egg_substidairy 1.15
243 2016-01-03T0 79 darjeeling_black_dry_goods 3.3
243 2016-01-03T0 1 strawberry produce 3.28
243 2016-01-03T0 11 pineberry produce 4.89
244 2016-01-07T1 70 orzo dry_goods 0.19
244 2016-01-07T1 43 garlic_naan bread 0.99
245 2016-01-06T0 26 green_juice beverages 0.25
245 2016-01-06T0 72 wild_rice dry_goods 0.27
245 2016-01-06T0 78 garam_masala dry_goods 1.44
245 2016-01-06T0 16 arugula_crisps snacks 2.43
245 2016-01-06T0 9 tangelo produce 0.96
245 2016-01-06T0 83 soy_ginger_trail_snacks 0.39
246 2016-01-07T1 8 pluot produce 3.99
246 2016-01-07T1 43 garlic_naan bread 0.99
247 2016-01-07T1 55 parmigiano_reggidairy 1.1
247 2016-01-07T1 46 frozen_salmon frozen 16.99
249 2016-01-06T1 80 rooibos_tea dry_goods 3.49
249 2016-01-06T1 53 black_pepper_godairy 1.69
249 2016-01-06T1 45 butter_chicken frozen 1.29
249 2016-01-06T1 23 pine_nuts dry_goods 0.91
250 2016-01-05T1 52 cranberry_infuse dairy 1.79
250 2016-01-05T1 57 Kumatos produce 3.6
251 2016-01-04T0 7 tayberry produce 2.54
251 2016-01-04T0 17 bottled_organic_aother 2.67
252 2016-01-04T1 64 white_onions produce 1.22
252 2016-01-04T1 80 rooibos_tea dry_goods 3.49
253 2016-01-06T1 41 frozen_tamales frozen 1.09
253 2016-01-06T1 74 poppy_onion_sessnacks 0.75
253 2016-01-06T1 7 tayberry produce 2.54
254 2016-01-04T1 72 wild_rice dry_goods 0.27
254 2016-01-04T1 3 orange produce 1.02
254 2016-01-04T1 77 sugar_snap_peasproduce 2.67
254 2016-01-04T1 60 satsuma_orangesproduce 2.06
255 2016-01-08T1 26 green_juice beverages 0.25
256 2016-01-03T1 54 aged_gouda dairy 1.23
256 2016-01-03T1 84 buckwheat_flour dry_goods 2.59
258 2016-01-04T1 39 table_wafers snacks 0.59
258 2016-01-04T1 26 green_juice beverages 0.25
258 2016-01-04T1 65 purple_onions produce 1.32
258 2016-01-04T1 2 apple_fuji produce 1.44
258 2016-01-04T1 39 table_wafers snacks 0.59
259 2016-01-08T1 64 white_onions produce 1.22
259 2016-01-08T1 12 vegan_egg_substidairy 1.15
259 2016-01-08T1 64 white_onions produce 1.22
259 2016-01-08T1 30 camembert_cheedairy 0.91
260 2016-01-08T1 84 buckwheat_flour dry_goods 2.59
260 2016-01-08T1 18 chia_seeds dry_goods 0.67
product_type_partial rows transactions total_amount average_amount
produce 594 234 1,473.94 2.48
produce
Aggregation:
It's tough to crown a given function as the most valuable in data analysis, but SUM and COUNT
produce in the running. Aggregation allows us to understand potentially huge volumes of data very quic
Excel's most popular features, pivot tables, highlights the value of exploring data through aggre
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
a few things:
You can put the aggregations anywhere in the sheet that you want. For everyday Excel users, th
like a big deal—you can put anything in any cell. As mentioned in earlier worksheets, this flexib
to tricky situations. In this case, though, it's quite handy. As you can see, we have the entire dat
produce the left and the summary directly above this text box. The flexibility of the layout is excellent fo
produce work easy to consume. SQL is much more rigid—if you want this exact layout, you'll need to run
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 o
fits certain conditions. You have to use different functions if you want to segment, and there ar
them that it's hard to remember the differences (COUNT, COUNTA, COUNTIF, COUNTIFS, COUN
Once you've written those functions, they're annoying to update and tough to read. Pivot table
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 va
cell J2—it's a smaller number than cell I2 because there are multiple rows per transaction. This
as one trip to the cash register might be to purchase multiple items. If you look at the formula,
produce it's an unintuitive workaround (found here: https://exceljet.net/formula/count-unique-values-in
with-countif).
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
produce
nalysis, but SUM and COUNT are certainly
ge volumes of data very quickly. One of
exploring data through aggregations. More
gregation functionality.
s/8da2b54d038c
nctions/
product_type Average - Data Grouped Aggregations:
beverages In the previous worksheet we mentioned pivot tables and grouped a
an example pivot table. It does some of the things that regular aggre
bread —it makes it easy to add conditional statements to aggregations, it
canned_jarred_goods type of aggregation, and it can find distinct values (sort of).
dairy
If you haven't used pivot tables before, we suggest you learn about
dry_goods powerful. Here's a great resource: http://www.excel-easy.com/data
frozen
meat But pivot tables aren't perfect. They're not very responsive when ne
you add data, you have to refresh the pivot table, and if you add mo
other that you've done so. In most cases, people just make new pivot tabl
produce problems. Viewers typically assume that pivot tables are up to date,
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
table, it can break the links.
Groupings are scripted, which means that they can easily be transfe
another, unlike in Excel where pivot tables have to be set up from sc
Here's an example that will produce the same results you see in this
https://modeanalytics.com/tutorial/reports/d13dfea938c2/queries
In SQL, once you have made an aggregation, you can filter on that a
clause) or build upon it easily (using an outer query).
in SQL here:
ermediate/grouped-aggregations/