> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pba/10.2-analytics/pentaho-dashboard-designer-cp/create-a-chart/use-query-editor-pdd.md).

# 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/agS2ASX2hrcyeLN4pALm)

   | 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/D6zGdmqJhE5yS1YvbYDe)
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/GykNaFihSu2XpjLDFdgT)
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/10.2-analytics/pentaho-dashboard-designer-cp/create-a-chart/use-chart-designer-pdd.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/pba/10.2-analytics/pentaho-dashboard-designer-cp/create-a-chart/use-query-editor-pdd.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
