Connect to SQL queries
Once you have established a connection to your data source, you can specify a custom SQL query in Tableau.
You can use a custom SQL query to limit the amount of data used by Tableau to create visualizations. This is particularly important when working with very large tables and will ensure that your experience using Tableau remains smooth and responsive.
Note: Another way to limit the amount of data used by Tableau is to create a Quick Query
in 1010data and then add it to a SQL schema as a table. See Connect to 1010data Quick Queries for more information.
To create and connect to a Custom SQL query:
- After you have connected to 1010data in Tableau, select your Database and Schema.
-
Instead of selecting one of the available tables, double-click New
Custom SQL.
The Edit Custom SQL dialog appears.
- In Edit Custom SQL, enter your SQL query. Provide any filters, aggregates, or joins you want here. See SELECT Statements for syntax.
- You can click Preview Results to see a preview of your SQL query.
- If you are satisfied with your query, click OK.
- To rename your custom query, right-click Custom SQL Query and select Rename from the context menu.
- Enter the new name of the custom SQL query and press Enter.