Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Need to extract hours from Time field in table

Hello Community,

I need your help.I want to know that how can i extract hours from the "Time" field in table as i am trying to extract in the following way :

Load

SLUG,

Hour("Time") as [Extracted Hours]

from

Source file

but this query is giving me the null values in Extracted Hours column instead of giving me the hours extracted from the Time field.

kindly suggest me some solution,

Thanks in advance

1 Solution

Accepted Solutions
martinpohl
Valued Contributor II

Re: Need to extract hours from Time field in table

So use

hour(time#("Time",'hh:mm:ss:ff'))

Regards

6 Replies
martinpohl
Valued Contributor II

Re: Need to extract hours from Time field in table

what Format is your Time-field?

Please give an example

Re: Need to extract hours from Time field in table

Do you want this?

...

time(frac("Time")) as [Extracted Hours]

...

- Marcus

Not applicable

Re: Need to extract hours from Time field in table

time format in time field is : 05:00:02:19

Not applicable

Re: Need to extract hours from Time field in table

This query isn't extracting hours from time field.

I want to get the hours from time field and the format of time field is 05:00:02:19

martinpohl
Valued Contributor II

Re: Need to extract hours from Time field in table

So use

hour(time#("Time",'hh:mm:ss:ff'))

Regards

Not applicable

Re: Need to extract hours from Time field in table

Hey Martin Pohl now it's working perfectly.

Thanks a lot for the help.

Best Regards

Community Browser