Analyse & refresh BigQuery data in Google Sheets using Connected Sheets

You can use functions, charts, extracts, pivot tables and refresh BigQuery data in Google Sheets. 

Important: To access BigQuery data in Google Sheets, you need access to BigQuery. Learn how to get started with BigQuery.

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Chart.
  3. Choose where to place it.
  4. Click Create.
  5. At the right, choose your other settings.
  6. At the bottom right, click Apply.

Learn more about charts in Google Sheets.

Tip: To update the chart based on the latest BigQuery data, at the bottom of the chart, click Refresh.

Add a pivot table
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Pivot table.
  3. Choose where to place it.
  4. Click Create.
  5. At the right, choose your settings.
  6. At the bottom right, click Apply.

Tips:

  • Pivot tables can currently support up to 50,000 results.
  • To limit the amount of data that you see in your pivot table, specify the number of rows or columns to return. Update 'sort by' and 'order' to specify which rows or columns are returned. 
  • To add calculated fields with a SUM or custom formula, in the side panel, next to 'Values', click Add and then Calculated field. Learn how to add Calculated fields in pivot tables.
  • To update to the latest BigQuery data, at the bottom of the pivot table, click Refresh.
  • To view values at intervals within a range, use histogram grouping. Values that are higher than the maximum and lower than the minimum are grouped together.
Use a function

You can use some functions with BigQuery data.

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Function.
  3. Choose a function from the list.
  4. Select where to place the function.
  5. Click Create.
  6. Choose your reference column and add any other required parameters.
  7. Press Enter.
  8. Hover your mouse over a cell that contains the formula, and click Apply changes.


Tip: You can also type functions inside any cell. 

Pull data into an extract

You can analyse data offline or reference individual values and ranges within functions. You can pull up to 50,000 rows or 10 MB of your BigQuery data. If you try to pull more than this limit, only the first 50,000 rows will appear. 

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. Select an option:
    1. At the top, click Extract.
  3. Choose where to put it.
  4. Click Create.
  5. At the right, under 'Extract editor', add columns, filters and sort settings.
  6. At the bottom left of the extract, click Apply changes.
Add a calculation to all rows in a data set and view column stats

You can apply a calculation to all rows by adding a calculated column.

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the top, click Calculated column.
  3. Enter a formula using column names and supported Sheets functions. You can use basic math operations like =price * quantity or manipulate text with =RIGHT(orderId, 4)
  4. Click Add.
  5. At the bottom left of the Sheet, click Apply.

Tip: To view column stats, in the top right of a column, click the Down arrow Down arrow and then View column stats.

Supported functions
Logic functions
  • IF (can be used to detect potential errors, such as division by zero)
  • AND
  • OR
  • NOT

Lookup functions

Filter functions

  • FILTER
Text functions
  • LEFT, RIGHT, MID
  • UPPER, LOWER
  • LEN
  • CONCAT (&)
Basic maths
  • +, -, *, /
  • The negative sign (-) and the percentage sign (%)

Maths functions

  • ROUND
  • POW/POWER (^)
  • SQRT
  • ABS
  • LOG, LN, LOG10

Dates and times

  • DATE, TIME
  • YEAR, MONTH, DAY
  • HOUR, MINUTE, SECOND
Comparison
  • =, <>
  • >, >=, <, <=
Aggregations
  • SUM
  • SUMIF
  • SUMIFS
  • COUNT
  • COUNTBLANK
  • COUNTIF
  • COUNTIFS
  • COUNTUNIQUE
  • COUNTUNIQUEIFS
  • MIN
  • MINIFS
  • MAX
  • MAXIFS
  • AVERAGE
  • AVERAGEIF
  • AVERAGEIFS
  • VAR
  • VARP
  • STDEV
  • STDEVP

Other

  • ISBLANK (returns whether or not the given argument is NULL)

Refresh your data

BigQuery data doesn't automatically sync with Connected Sheets. To sync the data, you can refresh a specific item, everything within a data source or everything within all data sources. Once you’ve connected to a data source, you can refresh that data and all of the objects such as Charts, Functions, Extracts and Pivot Tables associated with that data. 
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. To the right, under 'Refresh options', click the items you want to refresh. To refresh all of the data, in the bottom right, click Refresh all.
Schedule a refresh

Important: Scheduled refreshes of Connected Sheets don't propagate any end-user context such as IP address or device information. Virtual Private Cloud Service Controls (VPC-SC) perimeters that use end-user context to restrict access will cause scheduled refreshes to fail.

A scheduled refresh will update all objects and data sources at a specific, preset time.
Important:

  • A scheduled refresh will run as the user that set up the schedule. If another user adds or updates an existing data source, the schedule will automatically pause. To unpause, contact the schedule owner or take over the refresh.
  • Objects in the preview or failed state will not be refreshed with a scheduled refresh. 
  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. At the bottom of the sidebar to the right, under 'Scheduled refresh', click Set up now.
  4. Choose your refresh frequency.
  5. Click Save.
Take over a scheduled refresh

To run a scheduled refresh as yourself instead of the original owner, you can take over a refresh. 

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, next to 'Refresh', click More More and then Refresh options.
  3. At the bottom of the sidebar to the right, under 'Scheduled refresh', click Edit.
  4. Choose your refresh frequency. 
  5. Click Save to transfer the scheduled refresh ownership to you.
     

View query details and cancel a query

Editors of a spreadsheet and users with the required BigQuery permissions can cancel a query that is running. 

To view query details for any database objects:

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom pop-up Refresh button, click info The info icon. to see query details in BigQuery.
    1. Note: The info icon. won't appear if the data can be obtained without running a query. Learn more about exploring table data without running a query.

To cancel a query for any database objects:

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. When a query is running or pending: At the bottom pop-up Refresh button, next to 'Running query' or 'Query pending', click Cancel next to the calculated running time.
  3. Click Confirm.

You can also cancel a query from the Refresh options sidebar:

  1. On your computer, open a spreadsheet in Google Sheets that is connected to BigQuery data.
  2. At the bottom, hover over the refresh icon Refresh, and next to Refresh, click More More and then Refresh options.
  3. To cancel running refresh individually, next to each item, click Cancel.
  4. Click Confirm.
Note: 
  • If you do not have the required BigQuery permission for a BigQuery dataset, the action to cancel a query cannot be completed.
  • A query that failed due to a Sheets timeout may keep running in the database.

Next: Write & edit a query with BigQuery data in Sheets

Related articles

true
Visit the Learning Center

Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more.

Search
Clear search
Close search
Google apps
Main menu
11036595396950149525
true
Search Help Centre
true
true
true
true
true
35
false
false