I have to collect the SQL from the Workbook for my migration project. All Data sources are already published in Tableau server Repository.
I tried to collect the SQL from the following folder path.
"C:\Users\<username>\Documents\My Tableau Repository\Logs\log.txt"
if i go through the log file. i can able to see the "begin-query" and "end-query". But, the select statement is not in proper state to read and understand the query.
please refer the given below SQL from the LOG file.
(select\n (project\n (table [Extract].[Extract])\n (\n ([none:Calculation_8190227164602376:nk] [Calculation_8190227164602376])\n ([none:Calculation_8590227155827096:nk]\n (= [day]\n (to_date\n (to_str\n (-\n (to_datetime\n (truncmonth\n (-\n (to_datetime\n (truncmonth\n (today)\n )\n )\n 1)\n )\n )\n 1)\n )\n )\n )\n )\n ([none:channel:nk] [channel])\n ([none:metric:nk] [metric])\n ([none:metric_name:nk] [metric_name])\n ([none:Calculation_6260227163624326:nk] [Calculation_6260227163624326])\n ([none:Calculation_9800608145022926:nk] [Calculation_9800608145022926])\n ([none:metric_group:nk] [metric_group])\n )\n )\n (and\n (and\n (and\n (>= [none:Calculation_8190227164602376:nk] \"Broadband\")\n
Please let me know is there any other better way to collect the SQL from the work book?
If you want to look at the SQL Tableau generates, I recommend you use the performance recorder Help > Settings and Performance > Start Performance Recording.
However, the query you put above is Tableau's internal language used for talking to Tableau extracts. If you want to see SQL, you need to be talking to a SQL database.