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: 
Not applicable

SET a Time to a Timestamp

Hi,

Do you know how to set a time, in the timestamp.

Ex: If a process entry date is: 26/03/2012 01h56.

A working day starts at 8h00, so I want to store the value 26/03/2012 08h00.

if(hour(entry_date) < 8, ??Set(entry_date, 8h00)??, entry_date) as entry_working_date

Do you know a simple way to do it?

Regards,

Gonçalo

1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

There is a maketime() function so you could do something like

timestamp(floor(entry_date) + maketime(8))

The floor function is used to get rid of the time part of entry_date and then you add 8 hours to the entry_date.  The timestamp() format function is needed to change the number to a timestamp format again.

Karl

View solution in original post

2 Replies
pover
Luminary Alumni
Luminary Alumni

There is a maketime() function so you could do something like

timestamp(floor(entry_date) + maketime(8))

The floor function is used to get rid of the time part of entry_date and then you add 8 hours to the entry_date.  The timestamp() format function is needed to change the number to a timestamp format again.

Karl

Not applicable
Author

Tks Karl!