# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Did you mean:
Creator

## Time Intervals

Dear Experts,

I am trying to create a field with half hour intervals from time field like this :

7:00 to 7:30
7:30 to 8:00
8:00 to 8:30
8:30 to 9:00
9:00 to 9:30
9:30 to 10:00........

I tried this:

Time(floor([TimeField],(1/48)),'hh:mm') & ' to ' & Time(ceil([TimeField],(1/48)),'hh:mm') as HalfHour Interval.

But it is giving me wrong output like this:

7:00 to 7:00
7:00 to 7:30
7:30 to 8:00
8:00 to 8:00
8:00 to 8:30
8:30 to 9:00
9:00 to 9:00
9:00 to 9:30
9:30 to 10:00

Kindly help me to get the correct output.

Thank You

Labels (7)

• ### Visualization

1 Solution

Accepted Solutions
Employee

If the value of TimeField exactly corresponds to the full hour, then Floor() and Ceil() will return the same number. Compare with

Floor(5) = Ceil(5) = 5

Time(Floor(48*TimeField)/48,'hh:mm') & ' to ' & Time(Floor(48*TimeField+1)/48,'hh:mm') as HalfHour,

HIC

2 Replies
Employee

If the value of TimeField exactly corresponds to the full hour, then Floor() and Ceil() will return the same number. Compare with

Floor(5) = Ceil(5) = 5