2 Replies Latest reply on Oct 9, 2018 8:22 AM by Patrick Vincent

    Creating bins from time punch data

    Patrick Vincent

      I am trying to create hourly bins for time data based on the number of hours an employee works in a given month.  For example if an employee punches in at 4:30 PM (Punch Time) on January 3, 2015 (Punch Dt) and works 2 hours (Hours); I would like see .5 hours in the 16 bin, 1 hour in the 17 bin, and .5 hour in the 18 bin.  So far I seem to have bins but the total hours is a sum in the first bin (Hour of Day (bin)).

       

      I am new to the forums so any help would be appreciated. Thanks

        • 1. Re: Creating bins from time punch data
          lei.chen.0

          Hello Patrick,

           

          Welcome to Tableau Community!

           

          I have two questions.

           

          1. What is your definition for the expected bins?

          2. Could you explain the calculation logic for the bins?

           

          Patrick Vincent wrote:

           

          I would like see .5 hours in the 16 bin, 1 hour in the 17 bin, and .5 hour in the 18 bin. So far I seem to have bins but the total hours is a sum in the first bin (Hour of Day (bin)).

           

          In the workbook, the bins is created on punch-in time, so the result itself seems correct.

           

           

          Regards

          Lei

          • 2. Re: Creating bins from time punch data
            Patrick Vincent

            Thank you for looking at my issue. My attempt to solve the problem was to use bins.

             

            I have a calculated field that uses the datepart function to get the hour from the timepuch.  I then use that calculated field to create bins of 1 hour each.

             

            Like your example I can separate the time into their starting bin but they are the sum of the entire shift.  What I want is to have the time spread across each 1 hour bin their time punch covers.  For example: the time punch on 2/2/2015 at 16:30 hours is for 2.00 hours.  I want to see .5 hours in my 16:00 bin, 1.0 hours in my 16:00 bine and .5 hours in my 18:00 bin.

             

            Any help is appreciated.

             

             

             

             

             

             

             

            Patrick Vincent

              Administrative Solutions Group

              Brigham Young University

              801.422.7803 office

              801.404.7823 mobile

              patrick.vincent@byu.edu<mailto:patrick.vincent@byu.edu>