2 Replies Latest reply on Aug 23, 2012 4:17 PM by Ian McCauley

    Merging two tables in a single dataset

    Ian McCauley

      Excuse what is probably a pretty basic question - just can't seem to come up with the correct approach.

      I collect data from each individual as they use a database - ID, LogIn time, # of concurrent logins at that time, LogOut time, # of concurrent logins at logOut time; each is on a single row in an Excel table. In essence I have two tables, linked by the login ID, of pairs of (LoginTime) & (# at Login) and (LogoutTime) & (# at Logout).

       

      What I want to graph, on a single time axis, is the # at Login or Logout. I can simply append one set of data to the other, but obviously this would require manual intervention, and I'm sure there are Tableau techniques that can do the task automatically

       

      I'm not sure if this is a merging or a data blending issue. Thanks for any assistance.

        • 1. Re: Merging two tables in a single dataset
          Vladislav Grigorov

          Hello Ian,

           

          One way is to use custom sql, to "arrange" your data properly, i.e. to have one record for every event (be it login or logout). Effectively this takes the first 3 columns from all records in your dataset, and then it appends at the bottom the "second" table comprising columns 1,4 & 5 (the structure of the whole table must be exactly the same). You could also add a field to distinguish between login/logout event, but anyway, having all restructured in this way allows you to plot all events over a time axis. Attached is a workbook.

           

          Best,

           

          Vlad

          • 2. Re: Merging two tables in a single dataset
            Ian McCauley

            Hi Vlad,

             

            In the back of my mind was that custom SQL might provide the solution, but way beyond my capability to create. With your example I'm sure I can build the general solution I'm after.

             

            Thanks for taking the time to help me, and for the contribution to the Community.

             

            Ian