Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating buckets in Qliksense

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.

10 Replies
Anil_Babu_Samineni

For me this is working

I've used sureshqv Expression and added Single Colon

If([30MinInterval]> '0:00' and [30MinInterval]<= '4:59', 'Afernoon',

If([30MinInterval]> '4:59' and [30MinInterval]<= '7:59', 'Evening',

If([30MinInterval]> '7:59', 'Night','Morning')))


OR, This for full Time slots

If([30MinInterval]> '0:00' and [30MinInterval]<= '4:59', Dual('Afernoon',1),

If([30MinInterval]> '4:59' and [30MinInterval]<= '7:59', Dual('Evening',2),

If([30MinInterval]> '7:59', and [30MinInterval]<= '17:59', Dual('Night',3),

If([30MinInterval]> '17:59', and [30MinInterval]<= '23:59', Dual('Morning',4))))

OR, This for Full timestamp using Default function

If([30MinInterval] > Time#('00:00', 'hh:mm') and [30MinInterval] <= Time#('04:59','hh:mm'), Dual('Afternoon', 1),

If([30MinInterval] > Time#('04:59', 'hh:mm') and [30MinInterval] <= Time#('07:59','hh:mm'), Dual('Evening', 1),

If([30MinInterval] > Time#('07:59', 'hh:mm') and [30MinInterval] <= Time#('17:59','hh:mm'), Dual('Night', 1),

If([30MinInterval] > Time#('17:59', 'hh:mm') and [30MinInterval] <= Time#('23:59','hh:mm'), Dual('Morning', 1),

))))

Morning won't effect due to you don't have data on your file for second slot

HTH,

Best

ANIL

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful