Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Time from TimeStamp

Hi everyone,

How to get hour part from given timestamp ? Hour should get round of to nearest value.

eg :01:35:21 -> "02"

00:21:45 -> 00

11 Replies
Anonymous
Not applicable

=Date(now(),'HH')

this is for current hour

you can use =Date(yourfield/varibalename,'HH')

Anonymous
Not applicable

if your varibale/field in some other format

then

Date(Date#(yourfield/varibalename,'Original DDMMYYY etc format'), 'HH')

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

what is the use of variablename ?

Anonymous
Not applicable

if your time stamp is saved in variable then put variable name else if it is in field then use field name

Anonymous
Not applicable

best way is upload sample application

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

i have column having timestamp alone, i would like to take only hour part of it.

This is required to do hourly analysis.

below are the possible values .

01:51:00

01:52:00

01:53:00

01:53:38

01:53:48

01:54:00

01:54:24

01:54:48

01:55:00

01:55:07

01:55:29

01:56:00

01:56:20

01:56:40

01:56:44

01:57:00

01:57:57

Not applicable

if(minute(Datetime)>=35,hour(Datetime)+1,hour(Datetime))

anbu1984
Master III
Master III

=SubField('01:35:21',':',1) + If(SubField('01:35:21',':',2)>=30,1,0)

Anonymous
Not applicable

use this

Date(Date#(ColumnName,'HH:MM:SS'), 'HH')