Vues
Describe the data that reports can use with an SQL query and a list of fields.
Cette page n’est pas encore traduite. Tu lis l’original.
Sur cette page
A view tells Dashboard which data reports may use: an SQL query on your PostgreSQL database and one entry for each column that people can pick. You write views in the Views screen.

Create a view
- Select Views in the bar on the left.
- Select Create. The View specification editor opens.
- Enter the view as JSON, then select SUBMIT.
This view reads a table of sales:
{
"id": "sales",
"name": "Sales",
"sql": "SELECT region, product, amount, dtcreated FROM demo_sales",
"fields": [
{ "column": "region", "name": "Region", "type": "string", "group": true },
{ "column": "product", "name": "Product", "type": "string", "group": true },
{ "output": "@", "column": "amount", "name": "Amount", "type": "number", "format": 2 },
{ "column": "dtcreated", "name": "Date", "type": "date", "group": true }
]
}The view card appears in Views, and the view is ready to use in reports.
Edit or remove a view
Select the gear icon on the card of a view, then Edit or Remove. Removing a view also removes every report that uses it.
More about views
Views work as in OpenReports:
- Create a view: how the SQL and the fields work, with tips.
- Edit and remove views: how to change a field without breaking reports.
- View definition: every key of the JSON.