5 Replies Latest reply: Jul 13, 2017 11:50 AM by bruno bertels

# Group time-variable into intervals

I have a time-variable and I want to put the times into intervals. like "Below 5 minutes", "5-10 minutes", "Above 10 minutes".

How can I do that i Qlik Sense in the LOAD statement?

• ###### Re: Group time-variable into intervals

May be look here:

Buckets

• ###### Re: Group time-variable into intervals

I would be sthing like this:

If(YourTimeField< time#(10,'mm'), dual('Under 10 min', 1),

If(YourTimeField<= time#(15,'mm'), dual('10-15 Min' ,10),

If(YourTimeField<= time#(30,'mm'), dual('15-30 Min' ,15),

If(YourTimeField<= time#(45,'mm'), dual('30-45 Min' ,30),

If(YourTimeField<= time#(60,'mm'), dual('45-60 Min'' ,45),

dual('Over 60 Min' ,60))))))

• ###### Re: Group time-variable into intervals

Hello,

How would the script have to look like if i want to make intervals every 30 Minutes? Time Format is: hh:mm:ss.

I tried:

=If([Vrijeme izd. fakture]<Time#(8:00,'hh:mm'), dual('7:00-8:00',1))

But there was an error on ' : '.. appreciate any help. thank you

• ###### Re: Group time-variable into intervals

Hi

below a script that's working for me to class hour by intervals of 30 min :

time(class([YourTimeDimension],'00:30'),'hh:mm') as tranche_30_test,

Regards

'00:30' to get interval of  30 min

'00:15' to get interval of 15 min etc

Regards

Bruno

• ###### Re: Group time-variable into intervals

Both solved the problem, thanks a lot!