You want to just see then Custom SQL then go to the data source tab, drop down the "Data" menu and select 'convert to custom sql' it will generate the custom sql for you.
- Logs location here ---> C:\Users\<username>\My Documents\My Tableau Repository.
- live connection ? Then ---->check the log.txt and tabprotosrv.txt files.
- extract ? check the tdeserver.txt file.
- The tabprotosrv.txt file ----> SQL queries.
Useful blog ---->Viewing Underlying SQL Queries | Tableau Software
Please mark the answer as CORRECT/HELPFUL if it really helped you so that it can help others as well.