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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to convert Time into millisecond

Dear All, i want to know how to convert Time "00:00:00.000" to Millisecond. Ex : if time difference of two time 11:00:00.010 - 11:00:01.020 = 00:00:01.010. i want to show it as 1010 Please help

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

=Interval(Time#('11:00:01.020','hh:mm:ss.fff')-Time#('11:00:00.010','hh:mm:ss.fff'),'sfff')


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

=Interval(Time#('11:00:01.020','hh:mm:ss.fff')-Time#('11:00:00.010','hh:mm:ss.fff'),'sfff')


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert

Not applicable
Author

instead of Interval() if i use Timestamp() then also its working.. then what is different between these two...

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The difference is that timestamp is a point in time, not an duration between two points in time. You can see this if you make a timestamp out of 26 hours. Try these two in text boxes:

=interval(26/24,'hh')

=timestamp(26/24,'hh')


talk is cheap, supply exceeds demand
MarcoWedel

For sorting purposses you might also wish to try the expression:

=(Time#('11:00:01.020','hh:mm:ss.fff')-Time#('11:00:00.010','hh:mm:ss.fff'))*86400000

Hope this helps

Regards

Marco

Not applicable
Author

Thanks 🙂

MarcoWedel

You're welcome.

Regards

Marco

MarcoWedel

Hi,

I noticed some effects due to the limited resolution of real values, so the result has to be converted to an integer:

=Round((Time#('11:00:01.020','hh:mm:ss.fff')-Time#('11:00:00.010','hh:mm:ss.fff'))*86400000)

QlikCommunity_Thread_132xxx_Pic1.JPG.jpg

hope this helps

regards

Marco