# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## DateTime difference in Day Hours Minute Format in Qlik Sense

Hi Everyone

I want to calculate the date and time difference in Day Hours Minute Format

Suppose there are two dates

Date 1: 01/04/2018 10:20:00 AM (date format is MM/DD/YYYY)

Date 2: 01/06/2018 11:40:00 AM

The Result Should be:  2 Day 1 Hour 20 Min

Is this possible ???

3 Replies
MVP

## Re: DateTime difference in Day Hours Minute Format in Qlik Sense

Check Interval function

Ex:-

interval( A-B, 'D hh:mm' )

interval( Date1-Date2, 'D hh:mm' )

Contributor II

## Re: DateTime difference in Day Hours Minute Format in Qlik Sense

Hi Anand

The result is correct but the problem is:

1. I am calculating Average. With Avg function this is not working. My Measure is like this:

Avg(if(TRANSACTION_TYPE='DELIVER', interval(TRANSACTION_DATE - REC_TRANSACTION_DATE,'D  hh:mm')))

2. The result is like this "2 50:45" can I get like 2 days 50 hrs 45 min

Contributor II

## Re: DateTime difference in Day Hours Minute Format in Qlik Sense

Hi Anand

Average problem is solved

I need only (2 days 50 hrs 45 min) format