
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a Field From Calculated the Date Difference Between Two Dates Data
Hello All,
As i mention in the Subject, I want to calculate the date difference between two dates data, then store it into new field.
So my data basically like this
I want to calculate the difference between Closed Date and the Created Date in Day format, but it has decimal value.
So for example, the first data, the created date is 10/16/2018 9:00:53 AM and the Closed Date is 10/22/2018 11:11:40 AM, then for the result, if I count in the Excel using this function :
Closed Date - Created Date
I got the result = 6,09 Days.
I already tried this in the QlikSense :
Interval((date#(([Closed Date]),'MM/DD/YY hh:mm:ss')) - (date#([Created Date],'MM/DD/YY hh:mm:ss')),'d')
but the result is '-'.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try like this:
=num((date#(([Closed Date]),'MM/DD/YY hh:mm:ss TT')) - (date#([Created Date],'MM/DD/YY hh:mm:ss TT')),'##.00')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Zaidan_as ,
Try this:
Interval((date#(([Closed Date]),'MM/DD/YY hh:mm:ss TT')) - (date#([Created Date],'MM/DD/YY hh:mm:ss TT')),'d')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer,
Your expression working fine, but the result is integer. Can it change to the float, so the result is just like i write in the Post.
This is the result with your expression
I want the first data, from 6 to 6,09.
But if it's cannot change to integer to float, it's ok for me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try like this:
=num((date#(([Closed Date]),'MM/DD/YY hh:mm:ss TT')) - (date#([Created Date],'MM/DD/YY hh:mm:ss TT')),'##.00')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow. It working really fine. Thank you so much for your answer.
