Using SQL for Data Exploration
SQL Editor is only available to analysts role.
Beside the Dataset, Holistics also has the SQL Editor as another way to explore your data. This tool is suitable for running simple SQL queries to do ad-hoc analysis, to understand the shape of your data, or to prototype a data model setup.
Similar to the Dataset UI, it also has the visualization panel in case you want to visualize your query results:
The editor can be accessed from the top Navigation Bar:
When to Use SQL
SQL queries are useful when you need to:
- Perform complex calculations not easily expressed through the visual interface
- Join data from multiple sources in custom ways
- Test and prototype data transformations before modeling them
- Run ad-hoc analysis that doesn't fit standard patterns
Creating SQL Reports
You can create reports directly from SQL queries in Holistics. This allows you to leverage your SQL knowledge while still benefiting from Holistics' visualization and sharing features.
Basic Steps
- Navigate to the data exploration interface
- Choose the SQL query option
- Write your SQL query
- Preview the results
- Choose a visualization type
- Configure the chart settings
SQL vs Models
While SQL provides flexibility, we recommend using Data Models for most use cases because they:
- Are reusable across multiple reports and dashboards
- Provide consistent business logic and definitions
- Enable non-technical users to explore data
- Support advanced features like relationships and metrics
- Are easier to maintain and version control
Best Practices
- Use Models when possible: Build reusable models instead of writing SQL for every report
- Document your SQL: Add comments to explain complex logic
- Test performance: Check query execution time before adding to dashboards
- Validate results: Ensure your SQL produces accurate results
Running Non-Select SQL Queries
By default, Holistics only allows SELECT statements to run against your database. However, you can still run non-SELECT statements (like INSERT, UPDATE, DROP, CREATE, GRANT...) in the SQL Editor by toggling on Non-select query option:
If this is not toggled on, the non-SELECT query will be invalidated by Holistics.
This functionality is available to all account types that has access to Query Editor (i.e Admin & Analyst).
Non-select statements may affect your database directly and cause irreversible changes. Please take great care when using this functionality.
Limitations
SQL queries in Holistics may have certain limitations:
- Cannot be used as a source for other models
- May not support all database-specific features
- Performance depends on your database connection