Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Partner
Partner

Time stamp to Hours is not extracting properly

Hi All,

I am trying to extract the 24 hour time from a timestamp Date Time

example ;

,Time(round(frac([TransCont DateTime]),1/24), 'hh') as [TransCount 24 Hours]

but the the table is showing

TransCont DateTime TransCount 24 Hours
1/04/2011 10:23 AM10
1/04/2011 10:24 AM10
1/04/2011 10:25 AM10
1/04/2011 10:26 AM10
1/04/2011 10:27 AM10
1/04/2011 10:28 AM10
1/04/2011 10:29 AM10
1/04/2011 10:30 AM11
1/04/2011 10:31 AM11
1/04/2011 10:32 AM11
1/04/2011 10:33 AM11
1/04/2011 10:34 AM11
1/04/2011 10:35 AM11
1/04/2011 10:36 AM11

I noticed its converting 9.30-10.30 as 10  and  10.30-11.30 as 11.

Please anyone  got any idea? how can i create a correct table

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Time stamp to Hours is not extracting properly

That's because you are using round(), and those appear to be correct rounding. If you just want the hour, use:

hour([TransCont DateTime])

-Rob

View solution in original post

4 Replies
MVP & Luminary
MVP & Luminary

Re: Time stamp to Hours is not extracting properly

That's because you are using round(), and those appear to be correct rounding. If you just want the hour, use:

hour([TransCont DateTime])

-Rob

View solution in original post

MVP & Luminary
MVP & Luminary

Re: Time stamp to Hours is not extracting properly

Hi Prasanna,

Below script working for me, please check

Hour(TimeStamp#(TimeStam, 'M/D/YYYY hh:mm tt' )) AS Hour

Regards,

Jagan.

Partner
Partner

Re: Time stamp to Hours is not extracting properly

Thank you Rob,

It worked.

pratap6699
Contributor

Re: Time stamp to Hours is not extracting properly

  1. Name the Second sheet as ‘Dashboard’ and display the following information –
  • Productive and Nonproductive Hrs. for each week
  • Number of Employees present each day of the month per supervisor
  • Avg. Time Spent by Employee on Floor
  • Calculate Team Utilization (use formula -Total time/Number of days per activity )

anybody solve this please

doit.jpg