Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Output total hours

num(Interval(Timestamp(Timestamp#(Closed, 'DD/MM/YYYY hh:mm:ss')) - Timestamp(Timestamp#(Created, 'DD/MM/YYYY hh:mm:ss')), 'hh'), '#.##') as [Time Open (hours)],

  

I'm looking to pull total Open Hours.

Anyone see my error? I'm getting a blank output at the moment.

1 Solution

Accepted Solutions
sunny_talwar

Have you made sure to check if Closed and Created date were not getting correctly read as timestamps by QlikView? If they were, you could have just used

Num#(Interval(Closed - Created, 'hh'), '##') as [Time Open (hours)],

Also, do you need to convert hour into a number? if not, then Num#() function is not really needed.... but you can use it..

Finally, if you do need TimeStamp#(), then try like below.

Num#(Interval(Timestamp#(Closed, 'DD/MM/YYYY hh:mm:ss') - Timestamp#(Created, 'DD/MM/YYYY hh:mm:ss'), 'hh'), '##') as [Time Open (hours)],

View solution in original post

4 Replies
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

For me is working fine. Maybe Date formats.

Can you share an example of your data?

Saludos.

Clever_Anjos
Employee
Employee

Which format are Closed and Created?


Interval(Closed -Created)  should be enough

shiveshsingh
Master
Master

Hi

Try this

=num(interval(num(Timestamp(Closed,'DD/MM/YYYY hh:mm:ss'))- num(Timestamp(Created, 'DD/MM/YYYY hh:mm:ss')),'hh'), '#.##')

sunny_talwar

Have you made sure to check if Closed and Created date were not getting correctly read as timestamps by QlikView? If they were, you could have just used

Num#(Interval(Closed - Created, 'hh'), '##') as [Time Open (hours)],

Also, do you need to convert hour into a number? if not, then Num#() function is not really needed.... but you can use it..

Finally, if you do need TimeStamp#(), then try like below.

Num#(Interval(Timestamp#(Closed, 'DD/MM/YYYY hh:mm:ss') - Timestamp#(Created, 'DD/MM/YYYY hh:mm:ss'), 'hh'), '##') as [Time Open (hours)],