2 Replies Latest reply on Nov 21, 2016 8:44 PM by pinki sharma

    Tableau Custom Query

    pinki sharma



      I have different views in a workbook . one view is Top N  (using sets) and its working fine  but the performance is killing slow because of millions of data.

      So i am thinking to use custom query for topN view only.

      Custom Query --    select  * from table order by <measure> desc limit <value of N>

      example ------   select * from customers order by sales desc limit 10


      I want to give values of <measure> and <value of N>  with  parameters.


      I tried  above query but  i am getting some error while using limit. I want to know Is it possible in tableau to use this type of query ?

      or You can suggest other approach to improve sets performance.


      Please help.


      Thanks in Advance....:-)




      Pinki Sharma

        • 1. Re: Tableau Custom Query
          Dan Huff

          Whether or not a Custom SQL statement is valid is completely dependent on the syntax of the data source you are querying. You could try and build something against your database directly and then see if the same SQL works from Tableau as Custom SQL.

          1 of 1 people found this helpful
          • 2. Re: Tableau Custom Query
            pinki sharma

            Hi DAN,


            Thanks ..:-)

            Yes you are right. Query syntax was wrong.

            Actually i had worked on mysql  and  LIMIT works in mysql.

            but Now i am using oracle database . Oracle doesn't support LIMIT.


            Correct Syntax :  select * from(select * from temp order by a asc) where rownum<=3



            Pinki Sharma