Chapter 17: BigQuery: Hands-on Workshop
17.5. Bringing a Google Sheet into BigQuery
In this lesson, we're going to explore how to import your Google Sheet data into BigQuery as a table. We will cover two different methods, starting with the simplest one: importing a CSV file.
Importing GA Data as a CSV
First, let's export the GA data in CSV format:
- Go to your Google sheet.
- Click on File > Download > Comma-separated values (CSV).
- Save the file to your desired location.
Now that you have downloaded the GA data as a CSV file, let's bring it into BigQuery.
Creating a Table in BigQuery
Follow these steps to create a table from the downloaded CSV file:
- Go to BigQuery and navigate to your dataset (make sure it's empty).
- Right-click on the dataset and click Create Table.
- You will be presented with options for creating your table.
Selecting File Source
Choose these options:
- Create table from: Select "File".
- Click Browse and select the previously downloaded CSV file (sample_data_ga_data.csv).
Setting Destination
Now you need to set up where this new table should be created:
- Choose your project and dataset.
- Name your new table (e.g., "ga" for GA data).
- For Table type, choose "Native Table".
External Table will be covered in lesson 17.7.
Configuring Schema
Next, you'll decide on the schema for the new table:
- Choose either "Auto detect" or "Define schema manually".
- If defining manually, input each field name and its corresponding data type.
Once you've set up your schema, click on Create Table. The next lesson, you will find more about table schema in BigQuery.
Your Google Sheet data has now been imported into Looker Studio as a native table within BigQuery!
📩 Receive my weekly Looker Studio tips
🖇 Connect with me on LinkedIn