2 Replies Latest reply: Feb 25, 2018 6:35 PM by Pablo Labbe RSS

    Shift Calculation

    Monu Saraswati

      Hi All,

       

      I have a time field in my table and with that i need to create a shift dimension with 2 values: Day or Night.

      If the time field falls between 6:30AM to 6:30PM then its a day shift if between 6:30PM to 6:30AM then night shift.


      Time field is in the format DD-MM-YYYY HH:MM:SS


      Please help me with this.


      Thanks!

        • Re: Shift Calculation
          Bill Markham

          Maybe something like :

           

          if (      frac(YourTimeField) > maketime ( 06 , 30 )

              and

                   frac(YourTimeField) < maketime ( 18 , 30 ) 

              , 'Day' , 'Night' )

          • Re: Shift Calculation
            Pablo Labbe

            When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others