# Create a new Report

## How to create a new report?

* Click on Analyze from the navigation bar and navigate to **Reports .**
* Click on “**+ Create Report**” to create a new report.
* On the Build Report Using page - Choose **SQL Editor,** to build detailed reports using the SQL Query's  Output table using your data warehouse tables.
* **Report** info popup will appear and  click on the **"Start Building Report"**
* The **Create Reports** form opens up. **Give a name** to your report. &#x20;
* **SQL Reports Builder** window will open up in Edit Mode where you can write your SQL code to get the desired data.
* By default, the result/output of your SQL query is visualized as a **Table**.
* You may choose from other visualization options from the visualization selector dropdown appearing just below the SQL Editor.
* After running the SQL code in **SQL Editor** you may go to the **Visualization** tab on the left-hand side and choose the relevant Visualization (by default it will be Table) to enhance your data storytelling.
* Add/ Drop the table output columns obtained from running the SQL query in **SQL Editor** into the relevant sections under the **Visualization** tab.
* Click on **Visualize** button and your report will be ready.

## Build a Report using SQL Editor

Let's say you have an Order\_details raw table which you need to modify first using some SQL query and then use the final table to perform some analysis like "Product Category wise Total Orders".

* Click on “**+ Create Report**” and choose **SQL Editor.**
* Give a name to the Report and now you will land on the Report  -SQL Editor UI.
* Now in the SQL Editor tab write the SQL query which you want to use to modify the Order\_details table and click the Run button.

For eg: If you want to analyze only the North region order's data and also want to combine order\_id and location\_id columns to create a new column tracking\_id then you can write the following Code

`Select a.*, concat(a.order_id,'-',a.location_id) as tracking`` `*`id`*

&#x20;*`from orders_`*`details`&#x20;

`where a.region ='North'`;

* You will now have a final table as the Output of the above SQL query.
* Now go to the **Visualization** Tab below the Schema Browser tab and choose the **Pie Chart** option.
* In the **Build** panel go to the **Chart Setting** section and select Measure column Count of Order\_id  in the **Values** section and select Product Category column in the **Labels** section.
* Click on the  **Visualize** Button and your Pie Chart will be ready showcasing "Product Category wise Total Orders" for only the North region as you require.

<figure><img src="/files/pG9SYFhTZI4NA8tyTR6q" alt=""><figcaption><p>Product Category wise Total Orders</p></figcaption></figure>

Note: *SQL Reports in the new version is an update from the SQL Explores legacy feature.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sprinkledata.com/product/analysing-your-data/reports/build-sql-reports/create-a-new-report.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
