Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Date difference

Hello i need to know how to make the difference between two date, in particular i need to get the avarage time diff in days from dates.

I have many date to compare so i need a fast solution\idea to make this.

Example:

Date 1

01/01/2015

02/04/2015

Date2

01/03/2015

02/04/2014

In this case i need to get the avarage days between all these date, any ideas?

Thanks

Marco

5 Replies
PrashantSangle

Hi,

Try

Interval(date2-date1,'D')

regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MarcoWedel

Date2-Date1

(if dates already are numerical)

Date#(Date2,'MM/DD/YYYY')-Date#(Date1,'MM/DD/YYYY')

(if they are text)

marco_puccetti
Partner - Creator
Partner - Creator
Author

This statement seems to work:

Num(Avg(Date(DT_APERTURA_CONTO) - Date(DT_RICHIESTA_APERTURA,'DD-MM-YYYY')),'##.##')

Isn't it?

Thanks

Marco

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Num(Avg(DT_APERTURA_CONTO - DT_RICHIESTA_APERTURA),'##0.00')


Regards,

Jagan.

buzzy996
Master II
Master II

try tis,

tab4:

Load

Date#(Date1,'DD/MM/YYYY') as Date11,

Date#(Date2,'DD/MM/YYYY') as Date22,

rornum;

Load * Inline [

Date1,Date2,rornum

01/01/2015,01/03/2015,101

02/04/2015,02/04/2014,102

];

dtdiff.PNG