5 Replies Latest reply on Nov 6, 2015 9:01 AM by Paul Mathewson

    Time difference on a set start/end time

    Ram Gopal

      So I'm looking to see how much time surgeons start early/go over their blocked out times.


      Ex: If their block is 8 am to 3 pm and they have a procedure that finishes  at 7:45 am and then later in the day another one that finishes up  at 3:15 pm. I need to calculate the 15 minute difference from the start 0800 and the 15 minute difference on the end at 0300 so on that day they would be 30 minutes out of their utilized time. 

        • 1. Re: Time difference on a set start/end time
          Daniel Vincent

          Can you post up a sample data set included in a packaged workbook?  This will help answer the question in more detail.

          • 2. Re: Time difference on a set start/end time
            Ram Gopal

            Not sure how to do the packaged workbook but I've attached the excel of what the data looks like.


            So the Column 'B' is the time we use for the instance. If it's after 0800 or 1500 then I need the minutes from each of those respectively.

            • 3. Re: Time difference on a set start/end time
              Paul Mathewson

              Hi Ram,


              I put together an example in Tableau for you.  It seems like you wanted both the end time and in time (from block time) to be compared to Column B or Discharge time.  It may make more sense to compare In to Patient In to In and Discharge to Out, but that is your call.  I've changed the data a bit to split the block time in to a start and end time.  That way we can use it in a calculated field.  Currently, this workbook analyzes the difference in minutes but that could be changed.  This could also be done strictly in Tableau but would take many calcs to get the date parsing right from block time.


              Hope this provides some ideas for you.




              • 4. Re: Time difference on a set start/end time
                Ram Gopal



                I tried to open that workbook and apparently I'm not on the most updated version of Tableau. I'm on the desktop version 9.0, any idea how I can see this file?



                "This file was created by a newer version of Tableau. Please contact Tableau Software to upgrade your version."

                • 5. Re: Time difference on a set start/end time
                  Paul Mathewson

                  Hi Ram,


                  To view it you could upgrade your version of Tableau by downloading the newer one from their site.


                  I can tell you what's going on in case that's not an option.


                  1. Created two new columns in the excel data source:  Start Time and End Time
                    • These are date time values for when the block begins (8:00) and when it ends (15:00).  These also have the data value from from column B
                  2. Once we have these new columns, we can do a DATEDIFF calculation to find the difference between column B and the start and end times.  I did mine in minutes.
                  3. Then visualize the two new calculations that find the time difference from start and end time to Column B.  As I mentioned above, You may want to use Column A to compare to start time and Column B to compare to end time.  Though that's a business question.

                  All the Best,