# Use Query Editor

Learn how to use the Query Editor to retrieve dynamic data from a data source so that you can include the data in a new dashboard chart.

Complete the following steps to select a source and define data from that source to use in the Orders by Country {parm} chart. The Orders by Country {parm} chart is shown in the sample dashboard containing sales performance data for the example company, Steel Wheels.

1. Navigate to the User Console Home page.
2. Click **Browse Files**.
3. In the Folders pane, click to expand the **Public** folder, and then click the **Steel Wheels** folder.

   The content of the **Steel Wheels** folder opens in the Files pane.
4. In the Files pane, select **Sales Performance (dashboard)**.
5. In the File Actions pane, click **Edit**.

   The **Editing: Sales Performance (dashboard)** tab opens.
6. In the **Editing: Sales Performance (dashboard)** tab, navigate to the Orders by Country {parm} pane.
7. Click the **Insert Content** icon, and then click **Chart**.

   The following image shows the **Insert Content** icon and the **Chart** option.

   ![Location of the Insert Icon and Chart list option in the Query Editor.](/files/0RG5KF9QBmh8Am5ikQxw)

   | Item | Name           |
   | ---- | -------------- |
   | 1    | Insert Content |
   | 2    | Chart          |

   A warning opens for discarding current content.
8. Click **OK**.

   The Select a Data Source window opens.
9. Select **Orders** and click **OK**.

   The Query Editor window opens.
10. In the Categories / Columns pane, click to expand the **Customer** list.
11. Select **Territory**, and then click the top right arrow to add the Territory column to the top right table.

    The following image shows the **Territory** option that you select in the Categories / Columns pane, the top right arrow that you click to add the Territory column to the top right table, and the top right table where you add the Territory column.

    ![Location of the Territory option, top right arrow, and Territory column in the Query Editor.](/files/KLVDUvol7aKnK1GEqnUh)
12. In the Categories / Columns pane, click to expand the **Orders** list.
13. Select **Total**, and then click the middle right arrow to add the Total column to the middle right table.
14. Click **Preview** to preview the table with data from the source that you selected in the columns that you added.

    The following image shows the Preview window that contains a table with order data in the Territory and Total (SUM) columns.

    ![Preview window in the Query Editor.](/files/J7iRtE74D22sX3bAv58n)
15. Click **Close** to close the Preview window.
16. Click **OK**.

    The Chart Designer window opens.

Learn how to create a chart in the tutorial, [Use Chart Designer](/pba/pentaho-dashboard-designer-cp/create-a-chart/use-chart-designer-pdd.md).


---

# 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.pentaho.com/pba/pentaho-dashboard-designer-cp/create-a-chart/use-query-editor-pdd.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.
