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: 
TomBond77
Specialist
Specialist

Calculate with Timestamp field

Hi experts

I would like to calculate the difference in hours between these two fields.

Can you help me on this?

Many thanks!

 

TomBond77_1-1688116846160.png

 

 

Labels (6)
3 Solutions

Accepted Solutions
NiTo
Creator
Creator

Hi, Try using this

Interval(Starttime - FinishTime, 'hh:mm:ss') as Diff

Hope it will work

View solution in original post

TomBond77
Specialist
Specialist
Author

No, for 1:30:00 I would like to get 1.5. 

View solution in original post

NiTo
Creator
Creator

Try

Interval#('1:30:00', 'hh:mm:ss') * 24 = 1.5

View solution in original post

6 Replies
NiTo
Creator
Creator

Hi, Try using this

Interval(Starttime - FinishTime, 'hh:mm:ss') as Diff

Hope it will work

TomBond77
Specialist
Specialist
Author

can we transform the result into a field like:

48:00 --> 48.0

or

2:30 -> 2.5 ?

 

Thanks

NiTo
Creator
Creator

So instead of 1:30:00 , u want the result to come up as 1:30? Am, I correct?

TomBond77
Specialist
Specialist
Author

No, for 1:30:00 I would like to get 1.5. 

NiTo
Creator
Creator

Try

Interval#('1:30:00', 'hh:mm:ss') * 24 = 1.5

TomBond77
Specialist
Specialist
Author

how can you add 2 hours which changes the HH but also the date if necessary?

TomBond77_0-1688128503721.png