Export data from BigQuery to Google Sheets
You can use Awesome Table Connectors to export from BigQuery to Google Sheets. Exporting to Google Sheets via Awesome Table Connectors allows you to access raw data, schedule refresh to get regular updates, and configure your output sheet's layout, among other features.
This article demonstrates how to use Awesome Table Connectors to get a large dataset from BigQuery and import it into Google Sheets. You can use your own dataset and follow along.
Prerequisites
- You have logged in with the Awesome Table BigQuery connector.
- You have at least one project that contains a dataset that you can use in your BigQuery account.
Open the Select data drop-down and select the method you want to use to import data. We are using Run SQL query.
Open the Project drop-down and select the project that you want to use.
noteIf you are using a public dataset, you can use any project in your account, even if it does not contain the dataset.
Enter a query. We are using Google Trends' top international search terms for the latest available data:
SELECT
country_name,
term,
ARRAY_AGG(STRUCT(rank,week) ORDER BY week DESC, refresh_date DESC LIMIT 1) x
FROM
`bigquery-public-data.google_trends.international_top_terms`
WHERE
refresh_date =
(SELECT
MAX(refresh_date)
FROM
`bigquery-public-data.google_trends.international_top_terms`)
AND
week =
(SELECT
MAX(week)
FROM
`bigquery-public-data.google_trends.international_top_terms`
)
GROUP BY
country_name, term
ORDER BY
(SELECT country_name FROM UNNEST(x)), (SELECT rank FROM UNNEST(x))noteThe public dataset Google Trends - International we use in this example is available only if you have a Google Cloud account. You must have a Google Cloud account to run requests using public datasets.
(Optional) In the Output options, configure how your data will be inserted into your spreadsheet.
(Optional) Use Preview to choose the columns you need, edit their names, and configure a sort order.
- Click Preview.
A new window opens. - Make the changes you want.
- Click Apply changes.
- Click Preview.
Click Run to start your request.
Awesome Table Connectors informs you if you successfully exported to Google Sheets.
You have successfully imported data from BigQuery. Successful requests are automatically saved and displayed in the Home screen.
