# Query Syntax

Presight supports a syntax that allows you to type out what you want to ask in a fast and much more human-friendly format, instead of having to select data fields in existing BI tools.

The syntax for query data on Presight (following **/chart** or **/records table** commands) is:

<mark style="color:blue;">**`[Metric Name]`**</mark>` ``by`` `<mark style="color:green;">**`[Dimension Name]`**</mark> <mark style="color:orange;">**`[Dimension Value]`**</mark> <mark style="color:purple;">**`[Time Period]`**</mark>

Example:

> *<mark style="color:blue;">**Sales**</mark> by <mark style="color:green;">**Region**</mark>* *<mark style="color:orange;">**North America**</mark>* *<mark style="color:purple;">**this month**</mark>*
>
> *<mark style="color:blue;">**Customer Count**</mark> by <mark style="color:green;">**Product**</mark>* *<mark style="color:orange;">**All**</mark>**&#x20;**<mark style="color:purple;">**quarter over quarter**</mark>*

For every component, Presight will prompt you a choice menu through which you can complete the query quickly to generate the data you want.

### Metric Prompt

All the metrics you have access to will be presented to you in the prompt following the trigger syntax **/chart** or **/records table.** You only have to type it out and select the matching result.

<figure><img src="/files/yEvE14zZD1Sp90MOfEPz" alt=""><figcaption><p>Metric Prompt</p></figcaption></figure>

### Dimension Prompt

<figure><img src="/files/Fd9FAETmfTy0DWcdjCDU" alt=""><figcaption><p>Dimension Prompt</p></figcaption></figure>

All the dimensions available to the selected metric will be listed next. Choose the dimension you'd like to see the metric broken down by, or select **None** if you don't need it dissected.

### Dimension Value Prompt

<figure><img src="/files/8vaNM3xDihC9sIycJvw8" alt=""><figcaption><p>Dimension Value Prompt</p></figcaption></figure>

Sometimes you have a specific question, like *"What is the current sales for Region Europe?"* - rather than a need to see Sales broken down by all regions. For that, you can navigate to the specific values and select them when the Dimension Value prompt appears, else, you can proceed with **All**.

### Time Period

<figure><img src="/files/eWgE20fUfDjVICvjY1TP" alt=""><figcaption><p>Time Period Prompt</p></figcaption></figure>

The last component of the query is to select the time period of which you want the chart to show the data from. You can either ask Presight in a regular style like this month, this year or ask it to compare the data period over period (month over month, year over year, etc)

{% hint style="info" %}
The purpose of the query is to **quickly get the relevant data out** in front of your eyes, so you can have a feel of it, or start playing around. You can always quickly adjust the chart to better fit your reiterated questions, using the menu options available on the widgets.
{% endhint %}


---

# 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://presight.gitbook.io/presight-v1.0/analysis/data-widgets/charts/query-syntax.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.
