arrow_back

Connected Sheets: Qwik Start

Join Sign in

Connected Sheets: Qwik Start

1 hour Free

GSP870

Google Cloud Self-Paced Labs

Overview

Connected Sheets brings you the power and scale of a BigQuery data warehouse to the familiar context of Google Sheets. With Connected Sheets, you can analyze billions of rows and petabytes of data in Sheets without specialized knowledge of computer languages like SQL.

This makes it easy for anyone, not just data analysts, to apply pivot tables, charts, and formulas to massive datasets and hone in on their most valuable customers or product lines; develop forecasting models, uncover trends, and perform ad hoc analysis with ease.

What you will do

In this lab, you:

  • Connect a BigQuery dataset to Google Sheets

  • Use Formulas to find the percentage of taxi trips that included a tip

  • Use Charts to inspect popularity and trends of payment types

  • Use Pivot tables to find out when taxi rides are the most expensive

  • Use Extracts to import raw data from BigQuery to Connected Sheets

  • Use Calculated columns to create a new column from transformations/combinations of existing columns

  • Use Scheduled refresh to set up automatic data refreshes for your analyses.

Setup

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.

This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.

What you need

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
  • Time to complete the lab.

Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.

Note: If you are using a Chrome OS device, open an Incognito window to run this lab.

Open Google Sheets

  1. Click the Start Lab button. On the left is a panel populated with the temporary credentials that you must use for this lab.

cs-panel.png

  1. Use this link and open the Google Sheets home page in a new incognito page.

  2. In the Google Sign in page, paste the username from the Connection Details panel. Then copy and paste the password.

If you see the Choose an account page, click Use another account.

Important: You must use the credentials from the Connection Details panel. Do not use your Qwiklabs credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).

  1. Click through the subsequent pages:

  • Accept the terms and conditions.
  • Do not add recovery options or two-factor authentication (because this is a temporary account).
  • Do not sign up for free trials.

After a few moments, you will be at the Google Sheets home page.

  1. In your Google Sheets tab, click on the Blank button under Start a New Spreadsheet to create a new sheet. You will connect this sheet to a BigQuery dataset in the following steps.

9a02c144d2b1c754.png

Connect to a BigQuery dataset

The data you will be analyzing will be taxi trips in Chicago. Start by connecting the public Chicago taxi dataset that's available in BigQuery to Google Sheets.

  1. Select Data > Data Connectors > Connect to BigQuery

ffad1919f2ee9b8e.png

  1. If you see a Connect and Analyze big data in Sheets pop-up, click Get Connected.

  2. Select YOUR QWIKLABS PROJECT ID > Public datasets > chicago_taxi_trips:

choose-dataset.gif

  1. Select taxi_trips and click _Connect.

11f447c85b9c13ac.png

  1. After about a minute, you should see a success message. You have just connected a BigQuery dataset to Google Sheets!

57b81a425000a5fb.png

Formulas

Next you will look at how to use Formulas with Connected Sheets. First, find out how many taxi companies there are in Chicago.

  1. Select Function > COUNTUNIQUE and add it to a new sheet.

f3d08030c86ecef1.png

  1. Ensure New Sheet is selected and click Create to add it to a new sheet:

c8520ab9a12e149f.png

  1. Specify the company column by changing the value of your cell at row 1, column A to this:

=COUNTUNIQUE(taxi_trips!company)

Click Apply.

9a8370b95c47aec4.png

  1. Looks like there are 164 taxi companies in Chicago (your results may vary depending on the date the data is accessed).

10ab94f6bf00e0ea.png

Next, find the percentage of taxi rides in Chicago that included a tip.

  1. Using the COUNTIF function, find the total number of trips that included a tip.

Copy and paste this function into the cell at row1, column D:

=COUNTIF(taxi_trips!tips,">0")

Click Apply.

25908f271d4cbdad.png

  1. Now, use the COUNTIF function to find the total number of trips where the fare was greater than 0.

Add this function into the cell at row1, column E:

=COUNTIF(taxi_trips!fare,">0")

Click Apply.

994bd1e7801f3b2e.png

Click Check my progress to verify the objective. Use Formulas in Connected sheet

  1. Finally, compare the values from the previous two steps.

Add this function into the cell at row1, column F:

=D1/E1

Turns out around 38.6% of taxi trips in Chicago included a tip (your results may vary depending on the date the data is accessed) . 81f0869946b50fbe.png

Charts

What forms of payments are people using for their taxi rides? How has revenue from mobile payments changed over time?

Try viewing this information with Charts.

  1. Return to the taxi_trips tab by clicking on it at the bottom of your Google Sheets page.

3ec85600f2787489.png

  1. Click on the Chart button. Ensure New Sheet is selected and click Create.

d9cefcbdc8fe26c4.png

  1. In the Chart editor window, under Chart type, select Pie chart.

2223a96aff459ee2.png

  1. Various columns of the data are listed to the right. Drag payment_type to the Label field. Then drag fare into the Value field and click Apply.

edit-pie-chart.gif

  1. The value of Cash payments slightly edges out the value of Credit Card payments.

e5b3bbc118a1ac9.png

  1. Under Value > Fare, change Sum to Count. Click Apply.

f9b99a2a2621ab44.png

  1. Now, the Cash transactions significantly outnumber Credit Card transactions, implying that the latter has a higher average value.

3971c858f11134b3.png

Next, find out how mobile payments have changed over time by using a line chart.

  1. Return to the taxi_trips tab by selecting it at the bottom of your Google Sheets page.

  2. Select the Chart button. Ensure New Sheet is selected and click Create.

  3. Click on the Chart Type dropdown and select the first option under Line:

a3dc0eaa28c2c1bb.png

  1. Drag trip_start_timestamp to the X-axis field.

  2. Check the Group by option and select Year-Month from the dropdown list.

edit-line.gif

  1. Drag fare into the Series field.

  2. Click Apply.

d61578f23604635f.png

  1. The overall revenue peaked in 2015. But, how have mobile payments changed over time?

84ab9da66a9ce7d8.png

  1. Under Filter click Add > payment_type.

64f9a28de014ff98.png

  1. Select the Showing all items status dropdown.

  2. Click on the Filter by Condition dropdown and select Text contains from the list.

  3. Input mobile in the Value field.

  4. Click OK.

add-filter.gif

  1. Click Apply to generate a new line chart.

  2. From the chart, you should see that mobile payments have been on a general upward trend. What other observations can you make from the graph?

cbbee21b1a476eb6.png

Click Check my progress to verify the objective. Use Charts

Pivot tables

At which time of day are there the highest amount of taxi rides? In the following section, you will analyze this using pivot tables.

Return to the taxi_trips tab by selecting it at the bottom of your Google Sheets page.

  1. Click on the Pivot table button.
  2. Ensure New sheet is selected and click Create.

c15215410e7070d0.png

  1. Drag trip_start_timestamp into the Rows field.

  2. Choose Hour for the Group By option.

c3677409c5fbb55c.png

  1. Drag fare into the Values field
  2. Select COUNTA for the Summarize by option.
  3. Click Apply.

4d59b99f4ab8b023.png

You should now see a table that lists the number of rides per hour of the day (military time):

6dc798e836cd9bcc.png

At which time of day do you see the most taxi rides?

Next, break it down by day of the week.

  1. Drag trip_start_timestamp to the Columns field.

  2. Select Day of the week under the Group by option.

  3. Click Apply.

fc950db56fa03bf6.png

  1. Select the data range B3:H27 and select Format > Number > Number.

ae0a8b6bee752d4.png

  1. Click on the remove decimal place button twice to make the data easier to read.

8817456c765d364e.png

Now, apply some conditional formatting.

  1. Select all your data cells by clicking on the top left cell (first value for Sunday) and then shift + clicking on the bottom right cell (last value for Saturday).

  2. With all your cells selected, click Format > Conditional formatting.

  3. Select Color scale.

4dd0182f11a1b5a3.png

  1. Select the colors under Preview and choose White to Green. This will make the high values green and the low values white.

3037770c91498ff3.png

  1. Click Done.

  2. Close the Conditional Formatting window by clicking the x:

63db01acabd46c44.png

  1. Now, observe that peak periods on weekends are in the early morning and peak periods on weekdays are around the start and end of typical office hours.

2877a14b789cb9e5.png

What about the most expensive times for taxis?

  1. In the Values field, change the Summarize by option to Average.
  2. Click Apply.

e46729dee89b920a.png

  1. Turns out that Monday early morning taxi fares are the most expensive!

55e642c1900417b.png

Feel free to explore other combinations of data using pivot table and see what other insights you can uncover!

Click Check my progress to verify the objective. Use Pivot tables

Using Extract

Sometimes, you may find that you are only working with a small subset of the dataset. You may also want to take a closer look at the raw data itself. In such cases you might find it easier to import a subset of the dataset from BigQuery into Connected Sheets.

By default, Connected Sheets shows a preview of 500 rows of raw data in BigQuery. To import more data into Connected Sheets, you can use Extract.

For this example you will extract 25000 rows of data from the columns trip_start_timestamp, fare, tips, and tolls, ordered by latest trip first.

  1. Return to the taxi_trips tab by selecting it at the bottom of your Google Sheets page.
  2. Click on the Extract button.
  3. Ensure New sheet is selected and click Create.

382856a340cff841.png

  1. In the Extract editor window, click Edit under the Columns section and select the columns trip_start_timestamp, fare, tips, and tolls. Click outside the dropdown box to continue.

  2. Click Edit under the Sort section and select trip_start_timestamp. Click on Desc to toggle between ascending and descending order.

  3. Under Row limit, leave 25000 as it is to import 25000 rows.

  4. Click Apply.

cb8d12a1e0ec3e77.png

  1. That's it! You have just extracted thousands of rows of raw data from BigQuery into Connected Sheets!

74484fc28510ff50.png

Click Check my progress to verify the objective. Using Extract

Calculated columns

Calculated columns allows you to add new columns that are transformations or combinations of existing columns. You will create a calculated column that calculates tip percentage.

  1. Return to the taxi_trips tab by selecting it at the bottom of your Google Sheets page.
  2. Click on the Calculated columns button:

4ffde0b68e9757a1.png

  1. On the right you can see the columns of your dataset and the functions available. You can also click on the question mark in the description to see examples of calculated columns.

b166de6054c2437a.png

  1. Enter tip_percentage into the Calculated column name field.

  2. Then copy and paste the following formula into the formula field:

=IF(fare>0,tips/fare*100,0)
  1. Click Add.

8379af378707b028.png

  1. Click Apply.

Now you can see the percentage of the fare that was tipped under the tip_percentage column.

f5e6002369cec3e6.png

Click Check my progress to verify the objective. Calculated columns

Refresh all / Scheduled refresh

By default, all the analyses that you do on Connected Sheets remain unchanged until you decide to refresh it. This means that even if the data in BigQuery changes, your charts and tables will not change unexpectedly.

Now you'll see how you can update your analyses to the latest data, or schedule regular updates.

  1. To update a chart or table, select it then click the Refresh button.

refresh-graph.png

  1. You can also click the Refresh options button, located beside the name of your dataset, followed by Refresh all to update all Connected Sheets analyses to the latest data.

add466d591d3e83c.png

  1. To schedule a refresh, click on Setup now near the bottom of the Refresh options sidebar.

caf16dc00d43ed1f.png

  1. Finally, choose your desired frequency and time for the automatic data refreshes. Click Save.

5940e3edd754ff51.png

Congratulations!

You have learned how to

  • Connect a BigQuery dataset to Google Sheets
  • Use Formulas to find the percentage of taxi trips that included a tip
  • Use Charts to inspect popularity and trends of payment types
  • Use Pivot tables to find out when taxi rides are the most expensive
  • Use Extracts to import raw data from BigQuery to Connected Sheets
  • Use Calculated columns to create a new column from transformations/combinations of existing columns
  • Use Scheduled refresh to set up automatic data refreshes for your analyses.

Feel free to explore even more functions of Connected Sheets on your own. Happy analysing!

Google Cloud Training & Certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated: October 07, 2021
Lab Last Tested: October 07, 2021

Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.