3 Replies Latest reply on Apr 25, 2018 2:51 PM by Don Wise

    Create a range of time

    Patrick Friedmann

      I am looking for a little help. I import my data with a live refresh from a IBM server, the time comes over as a number. I have tried to create a range of times say 6:00 a.m to 7:00 a.m. to return a sum of everything process in that range. I can not get the range to work, has anyone been successful with making time ranges and return sums from what was in that range? Thanks in advance. 

        • 1. Re: Create a range of time
          Don Wise

          Hi Patrick,

          Without seeing a sample workbook (dummy data) or real data it is hard to tell what your end-result is, but based solely on your question, try something like the following:

           

          // From Hours 0600-0659

          IF  datepart('hour', [Your Date/ Time Field]) >=6 and datepart('hour', [Your Date/Time Field]) <7 THEN [What your trying to achieve...count, measure, dimension, etc.]

           

          // From Hours 0700-0759

          ELSEIF  datepart('hour', [Your Date/ Time Field]) >=7 and datepart('hour', [Your Date/Time Field]) <8 THEN [What your trying to achieve...count, measure, dimension, etc.]

           

          END

           

          If this helps, please mark this post (not the email) as correct so that others may find it and use it as well.  Thx, Don

          • 2. Re: Create a range of time
            Patrick Friedmann

            I have already tried this and other calculations very similar to this and I keep getting the same error messages, here is a copy of the project and dataset with screen shot

            • 3. Re: Create a range of time
              Don Wise

              Hi Patrick,

              I think the issue may be simple, but correct me if I'm wrong . Change the Field Type of SLHTDD to Date/Time.  I imported your .csv file and Tableau recognized it to the Hour field and grouped accordingly (see screenshot below).

               

              Mock-Up.png

              Change SLHTDD to Date:Time.png