Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between Date timestamps in Qlik Sense

Hi Community, I have been struggling for a while now with simply calculating a number of hours or even days between two date timestamps in Qlik Sense. I found a few suggested solutions from the community but I cannot seem to find one that fits my scenario 100%.

Please kindly assist. I simply want to see the difference between the start and the completed date in hours or days.

Please see attached sample source data file.

I have tried these 3 approaches with no success:

1.   Interval((date(timestamp#("Complete Time",'DD-MM-YYYY hh:mm:ss),'DD-MM-YYYY')) -  

    (date(timestamp#("Start Time",'DD-MM-YYYY hh:mm:ss'),'DD-MM-YYYY')), 'd')

2.   Ceil(Interval(Date#("Complete Time",'DD-MM-YYYY hh:mm:ss')- Date#("Start Time",'DD-MM-YYYY hh:mm:ss'),'d'))

3.   Interval(Date(Floor(Date("Complete Time" -"Start Time",'DD'))))

Thanks in advance!

1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

Hi,

May be as in attaced file

View solution in original post

4 Replies
sunny_talwar

May be this

Interval(TimeStamp#([Complete Time], 'DD/MM/YYYY hh:mm:ss) - TimeStamp#([Start Time], 'DD/MM/YYYY hh:mm:ss'), 'd')

Note that your date is using / instead of -.

ahaahaaha
Partner - Master
Partner - Master

Hi,

May be as in attaced file

Not applicable
Author

Thank you Sunny, I still cannot seem to return expected results with the above

Not applicable
Author

Thank you Andrey, exactly what I am looking for!!.

Thanks a lot everyone!