The Scenario
Your buyer meeting is at 11. It's 9:15 and the category manager just pinged you: she needs last week's top 100 SKUs by revenue in the shared Google Sheet before the deck goes to print. The data is in BigQuery. The sheet is open in front of you. There is no one to delegate this to.
The bad version:
- Open the BigQuery console, navigate to the right project and dataset, write or paste the SQL query, click Run, wait for results.
- Click Save Results → Google Sheets, let it create a new sheet in a random location in Drive, then copy the data out and paste it into the actual shared sheet — reformatting headers, adjusting column order, fixing the date format that BigQuery exports as UTC timestamps.
- Go back to the deck and hope the numbers don't change again before 11.
That sequence takes 20 minutes when nothing goes wrong. When something goes wrong — a typo in the query, a dataset name you can't remember, a result that lands in the wrong tab — it takes longer, and the clock is still running.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent built into your Google Sheet. It reads your sheet and talks to Google BigQuery directly — you write one prompt and the results land where you point them.
Run the BigQuery SQL query 'SELECT sku, SUM(revenue) as total FROM project.dataset.orders WHERE date >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY) GROUP BY sku ORDER BY total DESC LIMIT 100' and paste the results into my Google Sheet starting at A1 with headers
What You Get
- 100 rows written starting at A1, with "sku" and "total" as column headers in row 1.
- Rows sorted by total revenue descending, exactly as the SQL specifies.
- Each SKU code and revenue total lands in its own cell — no merged cells, no extra formatting.
- If the query returns fewer than 100 rows (because the last 7 days had fewer distinct SKUs), the actual count lands and no blank rows are appended.
What If the Data Is Not Quite Ready
The query needs a date range, not a fixed interval
Run the BigQuery SQL query 'SELECT sku, SUM(revenue) as total FROM project.dataset.orders WHERE date BETWEEN DATE(cell_B1) AND DATE(cell_B2) GROUP BY sku ORDER BY total DESC LIMIT 100' — use the date in cell B1 as the start date and the date in cell B2 as the end date, and paste the results into A3 with headers
The revenue field has a different name in this table
I need to query project.dataset.orders for last week's top SKUs, but the revenue column is actually called "sale_amount" not "revenue." Build the correct SQL and write the top 100 rows into my sheet starting at A1 with headers.
I want to join the orders table to a product dimension table
Run a BigQuery SQL query that joins project.dataset.orders to project.dataset.products on sku, pulls the product_name and category alongside the weekly revenue total, filters to the last 7 days, and writes the results into my Google Sheet at A1 with headers.
Clean the result and flag anything that looks off before writing it
Query project.dataset.orders for last week's top 100 SKUs by revenue, but before writing the results into my sheet at A1, check whether any row has a NULL sku or a negative total — flag those in a column called "review_flag" and write the rest normally.
One prompt is all it takes to add a quality gate to the pull.
Try It
Get the 7-day free trial of SheetXAI and open the Google Sheet where you need BigQuery results — point it at the right table, hand it the query logic, and it writes the output directly into your cells. You can also see how this works for inserting rows back into BigQuery or check the full Google BigQuery integration overview.
