2 Replies Latest reply on Dec 13, 2017 7:19 AM by Santiago Perez

    Obtain Underlying SQL for Calculated fields

    Santiago Perez

      I have a very complex workbook that has a lot of calculated fields. I need to be able to produce the underlying SQL for one of its worksheets, including the definition of each of its calculated fields (some of them are elaborate level of detail calculations).


      When I try to do this through a performance recording, all of the calculated fields get obfuscated (such as [Calculation_83192102]) and I cannot seem to get at the SQL behind them


      Other than scouring the logs, is there any way to obtain the underlying SQL?

        • 1. Re: Obtain Underlying SQL for Calculated fields
          Peter Fakan

          Hi Santiago,


          I think the short answer is no - however this is not a bug. As Tableau has been designed as a visual and interactive tool both from a developing and consumer perspective, the flipside is it doesn't write elegant code.


          I'd question more why do you need to provide exhaustive SQL though ? I am willing to put money on anybody who has the skills to read complex SQL statements can interpret and understand anything you do in Tableau without any training.





          • 2. Re: Obtain Underlying SQL for Calculated fields
            Santiago Perez

            Thank you Peter. However, while many users use Tableau purely as a stand alone BI tool, Tableau markets itself as valid option for OEM, able to be integrated as a module of a larger application. That is our use case, and being able to derive the SQL is imperative if that claim is true. In this case, it would enable our larger application to determine whether to render the tableau iframe by determining whether the result set would be valid for that user.


            I understand it won't be elegant SQL code nor do I expect it to be painless, would just like advice from the community on what the different paths forward are. I have found this tool modestly helpful

            Home · tableau/tableau-log-viewer Wiki · GitHub