> For the complete documentation index, see [llms.txt](https://whiteklay.gitbook.io/virtual-data-assistant/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whiteklay.gitbook.io/virtual-data-assistant/how-to-guides/data-analytics/query-book.md).

# Query Book

### Overview&#x20;

Query Book provides an interactive environment for exploring data, defining business questions and KPIs, generating SQL, and analyzing query results. Users can describe the required KPI or analysis in natural language, and VDA assists in generating the corresponding SQL and retrieving the results.&#x20;

Query results can also be visualized as graphs directly within the Query Book, enabling users to move from a business question to a visual insight without requiring a separate dashboarding platform.&#x20;

### Key Capabilities&#x20;

1. Define KPIs and analytical questions using natural language.&#x20;
2. Generate SQL automatically based on the requested KPI or analysis.&#x20;
3. Execute queries against the relevant datasets.&#x20;
4. Review query results within the Query Book.&#x20;
5. Visualize query results using automatically generated graphs.&#x20;
6. Iterate on queries and analysis within the same Query Book.&#x20;
7. Use metadata and available dataset information to improve the relevance of generated queries.&#x20;

### How to Use Query Book&#x20;

#### Step 1: Create a Query Book&#x20;

Create a Query Book for the analysis or business question you want to investigate.

<img src="https://803373986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEZ25VHhdl67JelwmVtBp%2Fuploads%2FqhBHDePlPy6xUeQeJX34%2Funknown.png?alt=media&amp;token=7da7159b-d3ae-47e5-afe6-fdcce42d67d8" alt="" height="250" width="664">

#### Step 2: Define the KPI or Question&#x20;

Enter the KPI, metric, or analytical question using natural language.&#x20;

For example: "What is the total transaction value by month for the current year?"&#x20;

<img src="https://803373986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEZ25VHhdl67JelwmVtBp%2Fuploads%2FYrdyAOp9g04kMx066acg%2Funknown.png?alt=media&amp;token=c379146f-da1f-4bee-b066-4e515b90d086" alt="" height="233" width="664">

#### Step 3: Generate SQL&#x20;

VDA interprets the request and generates the SQL required to retrieve the requested information from the relevant dataset.

<img src="https://803373986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEZ25VHhdl67JelwmVtBp%2Fuploads%2FBRnXHjWkC24LjXCv6zjX%2Funknown.png?alt=media&amp;token=a3d6e647-b78c-41b1-8659-87c4e7063dcd" alt="" height="386" width="664">

#### Step 4: Review the Results&#x20;

Execute the generated query and review the resulting dataset directly within the Query Book.&#x20;

#### Step 5: Visualize the Results&#x20;

Generate a graph from the query results to make the KPI or analytical insight easier to interpret.&#x20;

<img src="https://803373986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEZ25VHhdl67JelwmVtBp%2Fuploads%2FtJ8i6Pz9joVlu2WXg8gs%2Funknown.png?alt=media&amp;token=e97c3e13-8591-4dda-aa4c-05d9ee5506a5" alt="" height="383" width="664">

#### Step 6: Refine the Analysis&#x20;

Users can refine the KPI or query and continue the analysis within the Query Book.&#x20;

### Outcome&#x20;

Query Book enables users to move from natural-language business questions → SQL → query results → visual insights within a single analysis flow.&#x20;


---

# 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://whiteklay.gitbook.io/virtual-data-assistant/how-to-guides/data-analytics/query-book.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.
