2 Replies Latest reply on Oct 17, 2016 10:26 AM by Marc Maleika

    Joining two databases

    Marc Maleika



      I have two databases:

      1) Database 1 contains sales transactions. The timestamp for all transaction is HH/MM/SS.

      2) Database 2 contains the sum of customers that visited our store every hour. So the timestamp is HH.


      I would like to join both databases.



      When using "Time" as my join that joined DB does not correspond to the data in DB1 or DB 2 eg less visitors/ more revenue etc



      Do I need to aggregate DB1 to hourly before joining it with DB 2? If so, how?

        • 1. Re: Joining two databases

          Hey Marc Maleika,


          I think that you might need to change the field in the data base.

          Another option may be to create a lookup table where it has the date and datetime for each hour, etc and then join to that.


          You also could be able to use "data blending" to accomplish this. Are you familiar with that feature?

          You'll need to do something like convert the date/time value into a string using the STR function:


          ....and then truncate some of the characters off the end using the MID() function.

          You'll do this in both data sets, then "blend" on the result.


          Hope that helps!

          • 2. Re: Joining two databases
            Marc Maleika

            Hey Lénaïc,


            thanks for the answer. I followed your recommendation and blended both databases using visits as my primary data source, Tableau_-_Book3.jpgtransactions as my secondary datasource and time as link.

            The idea is to build a funnel with the data. Tried to follow the Tableau funnel example but my data does not allow to follow these steps. I am missing "phases" in both DBs. Any ideas for a workaround?