Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
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