--- title: "Query Analytics data" slug: "query-analytics-data" updated: 2026-10-27T16:32:18Z published: 2026-10-27T16:32:18Z canonical: "docs.hunters.ai/query-analytics-data" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.hunters.ai/llms.txt > Use this file to discover all available pages before exploring further. # Query Analytics data In SQL mode, pick the data type from the selector above the **Resources** panel. ![Data type selector](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/db-select.png?sv=2026-02-06&spr=https&st=2026-10-27T22%3A02%3A07Z&se=2026-10-27T23%3A02%3A07Z&sr=c&sp=r&sig=Qyw0sHNWC3lbRY4qfHtdtPy443of6R%2B%2FN1me1vkYQyY%3D) **Switching the data type discards your SQL and your AI prompt.** If you have already written or run something, you are asked to confirm first. Builder mode always uses OCSF Data. ## Analytics is PostgreSQL Analytics SQL is PostgreSQL, not Snowflake, so function names differ. Errors start with *PG Query syntax error:*, and the real Postgres message is at the end. - A literal `%` can be read as a parameter placeholder and cause a confusing error. Write `mod(a, b)`, not `a % b`. - Columns in `ORDER BY` must also appear in the `SELECT` list. - `information_schema` cannot be queried. Use the **Resources** panel to see tables and columns. For what each table holds and how to join them, see [Analytics tables reference](https://docs.hunters.ai/docs/en/analytics-tables-reference). ## Generate a query and a chart On Analytics, the prompt box generates both the SQL and a chart. Describe the metric you want and select **Generate SQL & chart**. The button shows each stage as it runs: *Planning the query…*, *Writing SQL…* and so on. ![Analytics prompt while running](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/analytics-prompt-running.png?sv=2026-02-06&spr=https&st=2026-10-27T22%3A02%3A07Z&se=2026-10-27T23%3A02%3A07Z&sr=c&sp=r&sig=Qyw0sHNWC3lbRY4qfHtdtPy443of6R%2B%2FN1me1vkYQyY%3D) When the build finishes, the SQL is typed into the editor and run, and the chart appears in the **Widgets** area: ![Generated chart](https://cdn.document360.io/5f63f0e0-3c70-4d00-b623-82493be0bde5/Images/Documentation/analytics-prompt-chart.png?sv=2026-02-06&spr=https&st=2026-10-27T22%3A02%3A07Z&se=2026-10-27T23%3A02%3A07Z&sr=c&sp=r&sig=Qyw0sHNWC3lbRY4qfHtdtPy443of6R%2B%2FN1me1vkYQyY%3D) - **Nothing is saved.** Save the query, or add the chart to a dashboard, to keep it. - Switching the data type, or opening a saved query, while a build is running cancels the build. - A build that has not finished after 30 minutes is abandoned. RAW Data has no AI generation yet; its prompt box is disabled with a *Coming soon* badge.