# 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="https://2657302904-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazylpawQDleaF3gtrhZd%2Fuploads%2FKj9RaQGBMGbHQV8XBipj%2Fimage.png?alt=media&#x26;token=69b00fe7-8375-48aa-bc7c-92863c45c388" 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.*
