4 Replies Latest reply on Sep 13, 2013 5:40 PM by Matt Lutton

    Linking custom SQLs vs blending results

    caroline ennis

      My manager mentioned that there is a way to link two custom SQL statements bringing in data vs setting relationships once results are extracted into Tableau. I have tried many times to create ONE SQL statement but there are too many max effdt statements, and it always times out. How can I link these two result sets along the primary key values for them to mingle effectively in Tableau?

        • 1. Re: Linking custom SQLs vs blending results
          Matt Lutton

          If you create/connect to two different data sources using the Custom SQL dialog, ensuring that either the field names you want to blend on are the exact same or ensuring that a relationship is added in the Data>>Edit Relationships dialog, you will see the link icon next to that field name in your dimension list.  Whichever source you want to be your primary is the source you should pull into the view first.

          • 2. Re: Linking custom SQLs vs blending results
            caroline ennis

            I've done this, but I cannot filter criteria using the secondary data source and I also constantly need to pull in the same field for both data sources, i.e. employee number and employee number. I was hoping there was a better way to blend them.

            • 3. Re: Linking custom SQLs vs blending results
              Matt Lutton

              I know very little about your data, but certainly what you are experience is a limitation of blending (filtering on fields in the secondary that are not linked to the primary).  Do you have any help in your organization, in terms of creating data sources?  I am just thinking that it may be possible to create one SQL view to connect to, rather than using the Custom SQL option in Tableau.  If this were possible, it would certainly make your life a bit easier.  However, I am not a database expert and may not be the most qualified person to answer your question.  Without knowing more about your data, and what you intend to do with it, it may be difficult to get a good response here on the forum.

              • 4. Re: Linking custom SQLs vs blending results
                Matt Lutton

                Also, it should be noted that you can filter on secondary data sources, but the limitation is that they must be used in the view and a relationship must exist in the fields being used for filtering.  I believe I am explaining this correctly, anyway.