3 Replies Latest reply on Nov 16, 2018 7:12 AM by Simon Runc

    Unique date range to compare two events

    Nicolas Besnier

      Hello everyone,

       

      Here is my problem:

       

      I have two data sources (or rather two tables A and B). In each I have an event history with a date & time for each (plus some other info like type, number etc). I would like to display a curve with the date (or rather all the dates of the calendar, whether or not there was an event), the number of events A and the number of events B. I imagine as in the screenshot in attachement.

       

      I tried to go through a third data source, an excel file that contains only the list of dates, but without success ...

       

      Thank you for your help

       

      Capture d’écran 2018-11-16 à 15.25.09.png

        • 1. Re: Unique date range to compare two events
          Simon Runc

          hi Nicolas,

           

          So based on what you've shown here, one way would be to Union the 2 tables (they would need to be in the same Excel workbook, or .csvs in the same folder).

           

          When you Union 2 tables Tableau creates a Sheet/Table Name dimensions (in this case they would be Table A and Table B), and the Dates, ID, and Sales/Count (assuming they are called the same in both tables) would all be in single columns. You can then just bring date onto the Viz, Use Count, and then use the Table Name to get a Line/Bar for each Table.

           

          Hope that makes sense, and helps

          • 2. Re: Unique date range to compare two events
            Nicolas Besnier

            HI SImon, and thank you for quick answer.

             

            I forgot a detail indeed, the two tables do not have the same fields except ID, DATE and COUNT. I will anymay try your solution

             

            Thanks

            • 3. Re: Unique date range to compare two events
              Simon Runc

              Cool.

               

              So in that case those 3 columns will align ...if there are other columns which are (basically) the same, but called differently in each file (say Category & Product Classification) you can tell Tableau that they are the same, by (on the connect to data screen) holding Shift and selecting both columns, right-clicking and selecting "Merge Fields".

               

              If this all gets a bit complicated, you could try Tableau Data Prep, which gives more functionality on this kind of re-shaping and combining data.