@juanpablo1
How are you connecting to your data source as instructed in step 3? Are you (1) loading the data into a database first and then connecting to the database through Tableau or are you (2) trying to connect Tableau directly to the text files (including CSV and tab delimited files)?
If the answer is (2) trying to connect Tableau to the text files, then the following may help.
I found this page on the Tableau knowledgebase: Connect to a Custom SQL Query - Tableau
The third paragraph says:
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. To connect to Excel or text files using the legacy connection, connect to the file, and in the Open dialog box, click the Open drop-down menu, and then select Open with Legacy Connection.
The fourth paragraph is a huge warning that support for legacy connections cannot be created now (since 19.1) and will be dropped soon (19.4). The page they direct you to for more information says it will not be available with 19.2.
Either way, if you're connecting to the raw data files, then it sounds like you need an additional step if you want to use custom SQL. The two recommended solutions would be to either use that custom SQL in Tableau Prep or load the data into a database and then use the custom SQL.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.