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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gauravgg
Partner - Creator
Partner - Creator

subtract timestamp with current timestamp?

Hi

I have a date field as below

Date

01/12/2016 01:20:00 PM

03/12/2016 03:30:00 PM

06/12/2016 05:20:00 PM

I want to subtract the above Date field with the current date time and the output should be in hh:mm:ss

(i want to find the difference between dates    ---(Date - current timestamp))

can anyone help me

Thanks in Advance

4 Replies
sushil353
Master II
Master II

Try this:

=Date(Today()-Date#(Date,'DD/DD/YYYY hh:mm:ss TT'),'hh:mm:ss')

jonathandienst
Partner - Champion III
Partner - Champion III

If DateField is a string:

=Interval(Today()-Date#(DateField,'DD/MM/YYYY hh:mm:ss TT'),'hh:mm:ss')

If you do the date interpretation during the initial load, then its simpler:

=Interval(Today() - DateField, 'hh:mm:ss')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gauravgg
Partner - Creator
Partner - Creator
Author

its not working

tresesco
MVP
MVP

Interval(Today()-Date#(DateField,'DD/MM/YYYY hh:mm:ss TT'),'hh:mm:ss')

Above expression (already suggested by Jonathan) should work. Could you post a qvw that shows how it is not working?