1 Reply Latest reply on Sep 6, 2017 6:56 AM by Donna Coles

    How do I blend dates when tables have no relationships?

    Huss H

      Hi so my data tables look like this. I have a table with "Ride Information" So this is the no of rides a driver made.

      Driver IDRequest Made on TimeBonus Ride
      123

      13-Jun-17 7:37:59 AM

      1
      12412-Jun-17 8:37:15 AM1
      32415-Jun-17 7:38:35 AM0
      90016-Jun-17 7:12:52 AM0

      In the second tables I have session data.

      Driver IDLogin TimeLogoff Time
      12312-Jun-17 7:12:52 AM16-Jun-17 8:12:52 AM
      56712-Jun-17 7:12:52 AM16-Jun-17 9:12:52 AM
      69212-Jun-17 7:12:52 AM16-Jun-17 11:12:52 AM

       

      I need my final table to have driver id, date and sum of bonus rides for a driver as well as online time totals (Online Time is logoff minus login time which is added as a calculated field)

       

      I'm having trouble with dates. I need a way to have all the dates for each driver and then I need their online time and sum of bonus rides on that date. Can anyone guide me as to what I should be doing? Im having trouble with the dates.

        • 1. Re: How do I blend dates when tables have no relationships?
          Donna Coles

          Hi Huss

           

          What is the source of your 2 data tables? 2 sheets in the same excel workbook? 2 tables in the same SQL data base? 2 Tableau published data sources?  The reason I ask is before tackling your date issue, I want to understand whether you can 'join' your data or have to 'blend'.  With Tableau blends, you have a primary & secondary data source and your data will only ever contain a row for the information in your primary data source, so you may not get everything you expect.

           

          For example, I notice in your sample data above that your 1st 'ride information' table has data for 4 drivers, only 1 of which exists in your session data table (and there are drivers in there which aren't in the ride information).  If you're expecting an output of 1 row for the 6 different driver IDs I can see in your sample data, then a Tableau blend is unlikely to work without a further data source set up containing 1 row per driver per date (which will need maintaining, so not ideal).

           

          To further help, the following would also be useful:

          1) An example of what you expect the actual output to be given the sample data you've provided above

          2) Would either of the tables contain multiple rows for a driver   - you've given a very narrow sample.. I'm assuming the ride information could have multiple rows for the same driver on the same date but with different times; I'm unsure about the session data

          3) The ideal would be to post a packaged workbook with a good sample of the data you're working with (see Packaged workbooks: when, why, how for further info on why this is useful)

          4) The version of Tableau you're working with.

           

          Thanks

           

          Donna