2 Replies Latest reply on Jan 17, 2017 2:12 PM by Jim Dehner

    Joining two Unions with Table Name

    Elliott Bowles

      Hi all,

       

      I am trying to connect two sets of data together in a somewhat tricky way, and am looking for your advice/help.

       

      I am working on an analysis involving store-level item data that comes on a weekly basis in two text files, one for inventory related information and the other sales related. I need to link these two 'buckets' of data based on the item, location, and week. All data is of the same format in both buckets.

       

      I discovered that when you create a union in a data source Tableau creates a 'table name' field which is good enough for me to keep track of each week's data (the files are named with the current week). So I know I can create a union for each data set and then do data blending based on the item number, location number, and table name (which is the same for the inventory file and sales file which live in separate folders to avoid duplication errors). I've tried this and it works fine with expected results. The below is rough outline of how that is structured.

       

      INVENTORY CONNECTION

           INV UNION

                Wk 1 2017.txt

                Wk 2 2017.txt

                Wk 3 2017.txt

       

      SALES CONNECTION

           SLS UNION

                Wk 1 2017.txt

                Wk 2 2017.txt

                Wk 3 2017.txt

       

      (Blended using table name, item number, store number)

       

      What I would prefer to do is create an inner join using the above three values to avoid having to make two data connections. However, when I do this Tableau is able to create the connection, but when i start dropping items into lists nothing shows up. It seems Tableau isn't seeing an 'apples to apples' relationship in the data source. This is odd as when I create the linkage with two separate data sets things work as expected.

       

      INVENTORY + SALES CONNECTION

           INV UNION

                Wk 1 2017.txt

                Wk 2 2017.txt

                Wk 3 2017.txt

           SLS UNION

                Wk 1 2017.txt

                Wk 2 2017.txt

                Wk 3 2017.txt

       

      (Inner joined using table name, item number, store number)

       

      Does anyone have any ideas? I'm afraid I can't share a workbook due to the nature of the data, but I'm happy to clarify/elaborate!

       

      Thanks all