10 Replies Latest reply: Feb 5, 2017 10:52 AM by Anil Babu RSS

    Creating buckets in Qliksense

    Aishwarya R

      Hi,

      I have the following data.

      Interval
      0:00-0.30
      0:30-0:59
      1:00-1:30
      1:30-1:59
      2:00-2:30
      2:30-2:59

      and so on up to 23:30-23:59. I want to create buckets as Morning,Afternoon and Evening for these times. Can someone help me with the same.

        • Re: Creating buckets in Qliksense
          Anil Babu

          As per your logic,

           

          What times and hours you want to see

           

          Morning, Afternoon, Evening

          00:00 AM - 12:00 PM, 12:00 PM - 06:00 PM, 06:00 PM - 00:00 AM --- Is this you are expecting to see?

          • Re: Creating buckets in Qliksense
            Chanty 4u

            you can try something like below 

             

            Edit with your respective fields.

            Load

            If(Interval<= 00:10:00, 'Under 10 min'

            If(Interval>=00:10:00 and VänteTid <= 00:15:00, '10-15 Min',

            If(Interval> 00:15:00 and VänteTid <= 00:30:00, '15-30 Min',

            If(Interval> 00:30:00 and VänteTid <= 00:45:00, '30-45 Min',

            If(Interval> 00:45:00 and VänteTid <= 00:60:00, '45-60 Min'',

            If(Interval> 00:60:00, 'Över 60 Min')))) as TidInterval

            • Re: Creating buckets in Qliksense
              Jonathan Dienst

              Adjust the time (and fieldnames too) to your requirements:


              If(Interval <= Time#('12:00:00', 'hh:mm:ss'), Dual('Morning', 1),

                  If(Interval <= Time#('18:00:00', 'hh:mm:ss'), Dual('Afternoon', 2), Dual('Evening', 3))

              ) as TimeBucket


              Duals to ensure that the buckets sort in a logical fashion.