2 Replies Latest reply on Jul 10, 2018 11:36 AM by Gagan Thapar

    Parameter in custom SQL query taking forever in Computing view layout.

    Gagan Thapar

      I have a custom sql query from oracle DB. Following query returns the results in less than a second. When I pull the columns in the Tableau sheet, I get the layout quickly.

       

      SELECT COLUMN_A,

        FROM TABLE_A ss, TABLE_B sc, TABLE_C pse, TABLE_D ps

      WHERE  ss.hnspartnerid = sc.swcustomerid

      and sc.COMPANY = 'AND'

      and ss.SITE = pse.SRCSITE

      and pse.SITE = ps.SITE

        AND ss.ACTTYPE <> 'Physical Location'

       

      When I replace the value with the parameter to create the dynamic query, "Compute layout" is taking forever. I get the results in less than a second on the "Data Source" tab.

       

      SELECT COLUMN_A,

        FROM TABLE_A ss, TABLE_B sc, TABLE_C pse, TABLE_D ps

      WHERE  ss.hnspartnerid = sc.swcustomerid

      and sc.COMPANY = <Parameters.CustomerID>

      and ss.SITE = pse.SRCSITE

      and pse.SITE = ps.SITE

        AND ss.ACTTYPE <> 'Physical Location'

       

      Can anyone guide me on what I am doing wrong?