3 Replies Latest reply on Jun 29, 2018 10:00 AM by Vinnie Ahuja

    Custom SQL query based on Filter - Filter based on a different SQL query

    John Howard

      Hi all,

       

      My first post so please be gentle.

       

      Apologies if this is an RTFM. I have spent several days trawling the web but have been so far unsuccessful.

       

      My workbook is connected to an Oracle database and using a Custom query to extract data. Because of the complexity of the query and the size of the dataset it is only feasible to run this with a condition (TARGET_NAME= <something>). I can do this with a parameter, I enter the value into a text box and refresh the data - it works really well.

       

      However, I'd like to refine it so that, rather than entering free-form text, I can use a drop-down, single value filter to select from all the possible values. To populate the values for this filter I want to use a different SQL query (not feasible to let Tableau get these from the original query).

       

      I thought that blending the 2 queries on the TARGET_NAME field would be the answer but when I select a value and refresh the data it seems to try and fetch the entire dataset rather than the desired filtered dataset.

       

      Hopefully that makes sense. Seems to me that this would be a fairly common scenario - hopefully someone has an answer.

       

      Thanks,

      John