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:

  1. After you have connected to 1010data in Tableau, select your Database and Schema.
  2. Instead of selecting one of the available tables, double-click New Custom SQL.
    The Edit Custom SQL dialog appears.
  3. In Edit Custom SQL, enter your SQL query. Provide any filters, aggregates, or joins you want here. See SELECT Statements for syntax.
  4. You can click Preview Results to see a preview of your SQL query.
  5. If you are satisfied with your query, click OK.
  6. To rename your custom query, right-click Custom SQL Query and select Rename from the context menu.
  7. Enter the new name of the custom SQL query and press Enter.
With your custom SQL query provided, you can now proceed to Visualize data as if the selection were a normal table.