Last Modified Date: 29 Sep 2023
Environment
Tableau Desktop earlier than 2019.1. (See IMPORTANT note in Additional Information)Answer
Option 1: When connecting to data sources that support SQL connections
- Connect to the data source.
- Drag at least one table into the canvas area.
- Optional: Drag additional tables into the canvas area to create joins.
- Navigate to Data > Convert to Custom SQL
Option 2: When connecting to Excel
- Connect to Excel with the legacy data connector
- Connect to the file.
- In the Open dialog box, click the Open drop-down menu, and then select Open with Legacy Connection
- Drag at least one table into the canvas area.
- Optional: Drag additional tables into the canvas area to create joins.
- Navigate to Data > Convert to Custom SQL
Additional Information
Note: The Convert to Custom SQL option may be grayed out or missing if the data source does not support a SQL connection, or if there is a cross-database join in the canvas area. For Excel and text file data sources, this option is available only in workbooks that were created before Tableau Desktop 8.2 or when using Tableau Desktop on Windows with the legacy connection.IMPORTANT: Starting in Tableau 2019.1, you can no longer create a new Legacy Excel or Text connection. Existing workbooks created with these legacy connections will continue to work until 2019.2, when all support for legacy connections will be removed. See the Legacy Connection Alternatives document in Tableau Community for alternatives to using the legacy connection.
Connecting to a Custom SQL Query
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials