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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.omni.co/feedback

```json
{
  "path": "/modeling/query-views/index",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Configuring query views

> Query views are workbook queries that have been saved to the model as a view.

Query views are views created from an underlying workbook query. This workflow allows you to do light transformations on data, which are then compiled as CTEs when queried.

## Query view basics

<AccordionGroup>
  <Accordion title="How are database views and query views different?">
    A **database view** is auto-generated from tables in your database.

    A **query view** is a reusable view created from a workbook query. The query can be created using Omni's point-and-click UI or through SQL.
  </Accordion>

  <Accordion title="Who can create a query view?">
    Users with **Connection Admin**, **Modeler**, or **Querier** permissions can create query views.
  </Accordion>

  <Accordion title="Who can query a query view?">
    Users with **Connection Admin**, **Modeler**, or **Querier** permissions can use query views in workbook queries.
  </Accordion>

  <Accordion title="Are query views visible in the model IDE?">
    Yes. Query views are included in the **Schemas** section of the model IDE's **Files** browser.

    You can identify a query view by its file name. Query view file names are appended with `.query.view`, for example `user_facts.query.view`.
  </Accordion>

  <Accordion title="How can I tell the difference between SQL and point-and-click query views?">
    You can tell the difference between a point-and-click and a SQL query view by how the underlying query is defined in the query view's file:

    * **Point-and-click queries** use the [`query`](/modeling/query-views/parameters/query) parameter
    * **SQL queries** use the [`sql`](/modeling/query-views/parameters/sql) parameter

    <CodeGroup>
      ```yaml title Point-and-click query view theme={null}
      query:
        fields:
          users.id: id
          users.age: age
          users.created_at: created_at
        base_view: users
        sorts:
          - field: users.created_at
      ```

      ```yaml SQL query view theme={null}
      sql: |
        SELECT id, age, created_at
        FROM users
        ORDER BY created_at 
      dimensions:
        user_id: {}
        total_sales: {}
        measures:
          count:
            aggregate_type: count
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Can query views be promoted to the shared model?">
    Yes. When you initially create a query view, it will only be available in the workbook where you create it. You'll need to [promote it to the shared model](/modeling/develop/promotion) to make it accessible outside the workbook.
  </Accordion>
</AccordionGroup>

## Creating query views

See [Saving queries as views](/analyze-explore/saved-views).

## Editing query views

Query views can be edited in a workbook or in the model IDE. See [Editing query views](/modeling/query-views/edit) for more information.

## Next steps

* [Save queries as views](/analyze-explore/saved-views)
* [Editing query views](/modeling/query-views/edit)
* [Query view parameter reference](/modeling/query-views/parameters)
