3 Replies Latest reply on Mar 23, 2017 9:51 AM by venky v

    Switching between primary and secondary datasources

    venky v

      Hello All,

      I am trying to blend the data from two data sources(A and B) with three fields CAL_DT, YST and LEAD_PID. Datasource A has CAL_DT & YST and Datasource B has LEAD_PID. Now if I select A as my primary data source I see * mark under LEAD_PID column where as if I select B as primary I see the data. Below are the pictures. Problem all my other dashboards are built using datasource A and I dont want to recreate them making B as my primary data source. Can you explain why Iam seeing * and is there any alternate solution to switch between my primary and secondary data sources? Thanks.

       

      Datasource "B" as primary and "A" as secondary.

       

      Datasource "A" as primary and "B" as secondary.

       

        • 1. Re: Switching between primary and secondary datasources
          Karthik Venkatachalam

          Venky,

          In blending, you only get the aggregate values of measures. That said, if you try to bring in dimensions, it would only display a *. That means there is more than 1 element on secondary DS. Because, a blending is not a join, to bring in all the dimension records. However, if you have one-one relationship, it would bring that first element only.

           

          If you are dealing with one-many between primary and secondary, you cannot use blending. Your only option is to Join.

          1) You could either go to the Database and join them and bring it back as a flat table.

          2) Or you could try your luck with a tableau join.

          • 2. Re: Switching between primary and secondary datasources
            Jamieson Christian

            Venky,

             

            You are trying to use a field from your secondary data source as a dimension. You cannot do that with data blending. Data blending is used to bring in aggregates from a secondary data source, and that implies that the secondary data source cannot be used to further segment the data. All of your dimensions must be in the primary data source, and the secondary data source is only used to bring in aggregate measures that correspond to the level of detail dictated by the primary data source.

             

            For your application, you will need to JOIN your data instead, thereby creating a single data source that incorporates both tables. Joins happen at the row level, rather than the aggregate level, so dimensions from both data sources can be used to segment the data on your view.

             

            If your tables come from the same connector (e.g. the same Excel file or the same RDBMS), you can directly join them in Tableau 9 or 10 (or even earlier versions, probably).

             

            If your tables come from two completely different data sources, you can use cross data source joins, introduced with Tableau 10.0. If you do not have Tableau 10, you are unfortunately stuck with data blending. In that case, you will need to either (1) restructure your data sources so that all of your dimensions appear in your primary data source, or (2) bite the bullet and rework your sheets to swap the primary and secondary data sources, like you showed in your example.

             

            I hope this helps.

            2 of 2 people found this helpful
            • 3. Re: Switching between primary and secondary datasources
              venky v

              Thanks you for the detail explanation.