Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
Honored Contributor

Re: Difference between Date timestamps in Qlik Sense

Hi,

May be as in attaced file

4 Replies
MVP
MVP

Re: Difference between Date timestamps in Qlik Sense

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
Honored Contributor

Re: Difference between Date timestamps in Qlik Sense

Hi,

May be as in attaced file

Not applicable

Re: Difference between Date timestamps in Qlik Sense

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

Not applicable

Re: Difference between Date timestamps in Qlik Sense

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

Thanks a lot everyone!