Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
WernerDC
Creator
Creator

Time Buckets from Timestamp

Good day Qlickers.

As you know, Dates are a headache in Qlik Sense. I always have a hard time around them.

 

How do I get a timestamp to hourly buckets?

Ive tried some stuff already but I cant seem to get it to work.

 

See the table attached:

WernerDC_0-1630009198508.png

I want to create Hourly buckets on that Timestamp if possible. My times are in 24hours.

This is my script:

WernerDC_1-1630009284352.png

 

Hope someone can help me.

 

Kind regards

 

 

5 Replies
Clever_Anjos
Employee
Employee

Use Trunc(yourdatetimefield,1/24) to convert to lowest hour

Clever_Anjos
Employee
Employee

In meantime "Dates are NOT a headache in Qlik Sense." 🙂 🙂


https://community.qlik.com/t5/Qlik-Design-Blog/Get-the-Dates-Right/ba-p/1476178

WernerDC
Creator
Creator
Author

This trunc is not recognized in my script?

WernerDC
Creator
Creator
Author

Hi,

I tried this and it works if I do a limited load thru the debugger. It returns exactly what I want.

Input:

WernerDC_0-1630049852390.png

Output: See Time and Bucket columns. It works.

WernerDC_1-1630049922608.png

 

Problem is, when I reload the entire App, the Time and Bucket Fields return Blank. What causes this?

 

Hope you can  help me

 

Kind regards

 

 

Clever_Anjos
Employee
Employee

I´m so sorry, my mistake

Use Floor(yourdatetimefield,1/24) to convert to the lowest hour