> ## Documentation Index
> Fetch the complete documentation index at: https://docs.queryful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# The query editor

> Read and write a report's query in QueryfulQL, with suggestions and error checking as you type.

Every report is a query in [QueryfulQL](https://docs.queryful.app/queryfulql/datasets/overview.md), a query language that reads like ShopifyQL. Expand the query card on any report to see the query behind it, and change it if you want to.

```sql theme={null}
FROM sales
  SHOW net_sales, orders
  GROUP BY sales_channel
  SINCE startOfMonth(-1m) UNTIL endOfMonth(-1m)
  ORDER BY net_sales DESC
```

## Writing a query

* Suggestions appear as you type: datasets after `FROM`, the dataset's metrics after `SHOW`, its dimensions after `GROUP BY`, and the values your store actually has after `WHERE`.
* Hover over a field to see what it means.
* Mistakes are underlined as you type, with the reason on the status line, like "Line 2: Column 'net\_sale' not found. Try net\_sales?".
* Press **Run**, or Cmd + Enter (Ctrl + Enter on Windows), to run the query.

Nothing changes until you run it.

To filter a report, add a `WHERE` line. For one country, for example:

```sql theme={null}
FROM sales
  SHOW net_sales, orders
  WHERE customer_country = 'United Kingdom'
  GROUP BY sales_channel
  DURING last_month
```

[WHERE](https://docs.queryful.app/queryfulql/syntax/where.md) lists every way to filter, and each dataset's page lists the fields it can be filtered on.

## Keyboard shortcuts

| Shortcut | Does |
| - | - |
| Cmd/Ctrl + Enter | Run the query |
| Cmd/Ctrl + Z | Undo |
| Cmd/Ctrl + Shift + Z | Redo |
| Cmd/Ctrl + E | Collapse or expand the editor |
| Tab | Accept a suggestion, or indent |
| Shift + Tab | Indent less |

The shortcuts button on the card lists them all.

## The date range and the query

The query's `SINCE ... UNTIL` or `DURING` line and the date button at the top of the page are the same thing: change one and the other follows. A saved report keeps its period as written, so "this month so far" stays this month so far whenever it's opened or sent.

## Learn the language

The [QueryfulQL](https://docs.queryful.app/queryfulql/datasets/overview.md) tab lists every dataset with its metrics, dimensions and filters, and the [linked records](https://docs.queryful.app/queryfulql/records/overview.md) a report can reach, like the customer behind an order.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.