In the Explorer panel, expand your project and select a dataset.
Click the dataset name to expand it.
The tables and views in the dataset appear.
Click the table name or a prebuilt report.
The Details tab displays the table's description and the Schema tab displays the table's schema definition.
Click Query and select either In new tab or In split tab.
A new tab opens with a sample query.
Write a query based on the field names that are populated in the Schema tab.
Click Run. This displays the preview of the query results.
Click Save view.
In the Save view dialog, do the following:
In the Project list, click Browse and select a project.
In the Dataset list, select a dataset to store the view. The dataset that contains your view and the dataset that contains the tables referenced by the view must be in the same location.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eBigQuery allows you to write custom queries based on table names or prebuilt reports within the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eYou can save custom queries in BigQuery as a query, enabling you to reuse them later by naming the query in the save query dialog.\u003c/p\u003e\n"],["\u003cp\u003eCustom queries can also be saved as a view, allowing for the selection of a project, dataset, and table name within the save view dialog.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating queries or views, users must select a dataset where the view is stored, and the dataset must be in the same location as the tables referenced.\u003c/p\u003e\n"]]],[],null,["# Custom queries in BigQuery\n\nThis page explains how to set up and view prebuilt reports in BigQuery.\n\nIn Google Cloud console, you can write your custom query based on the table name\nor prebuilt report and save it as a query or as a view.\n\nWrite custom queries in BigQuery as a query\n-------------------------------------------\n\nTo write custom queries in BigQuery as a query, do the following:\n\n1. In the Google Cloud console, go to the **BigQuery Studio** page:\n\n [Go to BigQuery Studio page](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** panel, expand your project and select a dataset.\n3. Click the dataset name to expand it.\n\n The tables and views in the dataset appear.\n4. Click the table name or a prebuilt report.\n\n The **Details** tab displays the table's description and the **Schema** tab displays the table's schema definition.\n5. Click **Query** and select either **In new tab** or **In split tab**.\n\n A new tab opens with a sample query.\n6. Write a query based on the field names that are populated in the **Schema** tab.\n\n7. Click **Run**. This displays the preview of the query results.\n\n8. Click **Save query**.\n\n9. In the **Save query** dialog, type a name for the saved query.\n\nYou can download and save queries to the selected location. For more information, see [Downloading and saving query results from the Google Cloud console](/bigquery/docs/writing-results#downloading-saving-results-console).\n\nWrite custom queries in BigQuery as a view\n------------------------------------------\n\nTo write custom queries in BigQuery as a view, do the following:\n\n1. In the Google Cloud console, go to the **BigQuery Studio** page:\n\n [Go to BigQuery Studio page](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** panel, expand your project and select a dataset.\n3. Click the dataset name to expand it.\n\n The tables and views in the dataset appear.\n4. Click the table name or a prebuilt report.\n\n The **Details** tab displays the table's description and the **Schema** tab displays the table's schema definition.\n5. Click **Query** and select either **In new tab** or **In split tab**.\n\n A new tab opens with a sample query.\n6. Write a query based on the field names that are populated in the **Schema** tab.\n\n7. Click **Run**. This displays the preview of the query results.\n\n8. Click **Save view**.\n\n9. In the **Save view** dialog, do the following:\n\n 1. In the **Project** list, click **Browse** and select a project.\n 2. In the **Dataset** list, select a dataset to store the view. The dataset that contains your view and the dataset that contains the tables referenced by the view must be in the same [location](/bigquery/docs/dataset-locations).\n 3. In **Table name**, enter a name for the view.\n 4. Click **Save**.\n\nYou can download and save queries to the selected location. For more information, see [Downloading and saving query results from the Google Cloud console](/bigquery/docs/writing-results#downloading-saving-results-console).\n\nWhat's next\n-----------\n\n- Learn how to [View prebuilt reports in Google connected sheets](/backup-disaster-recovery/docs/monitor-reports/view-reports-sheets)\n- Learn how to [View prebuilt reports in Looker](/backup-disaster-recovery/docs/monitor-reports/view-reports-lookerstudio)"]]