Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Hourly binding

Hi All,

I have sample data provided below. I have to create binding of times.Binding should be 10-2pm,2-7pm,7-11pm,11pm-10am How we would do this ?

 

0:00:30
0:31:30
1:00:00
1:31
9:25:39
9:45:10
10:00:00
11:25:00
11:45:00
12:00:00
13:47:00
22:00:00
23:00:00
2 Replies
maxgro
MVP
MVP

load

  time,

  if(time>=10/24 and time <=14/24, '10-14',

  if(time>=14/24 and time <=19/24, '14-19',

  if(time>=19/24 and time <=23/24, '19-23',

  '23-10'

  ))) as binding;

load

  time(Time#(if(SubStringCount(time, ':')=1, time & ':00', time), 'h:m:s')) as time

inline [

time

0:00:30

0:31:30

1:00:00

1:31

9:25:39

9:45:10

10:00:00

11:25:00

11:45:00

12:00:00

13:47:00

22:00:00

23:00:00

];

1.png

tresesco
MVP
MVP

Try like:

Class(Time#(Time,'hh:mm:ss')*24,4)