Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
Can anyone suggest me that how can we calculate the difference between two dates and the answer comes in nos. of days:
is there any function or something else
i will gv u an example that what i want to do ie:.......................................
i hv to calculate "avg payment time"
date 1: 6/26/2008 (is billing date means invoice generate on that date)
date 2: 7/15/2008 (is that date where payment is clear means all payment received on that date)
now, we have to calculate the difference between these two dates means (date2 - date1)
and output comes in "no of days" format. means how much days they will take to clear their bill.
plz tell me the suitable solution ASAP
Regards
Neetu Singh
Hi,
No. date. = [Payment recieved date] - [Invoice Generated Date ]
this will do.
-Sridhar
Hi,
see the attached example.
Maybe you have to use QV functions like Date# and Date to get the right format (see QlikView Help File for further information).
Good Luck!
Rainer
Hi Neetu,
If your 2 date fields are in date format, the answer is in your question : date3=date2 - date1, and just use avg(date3) to have the "average payment time".
If your date fields are not in date format, put them in date format with a date function...
Hope this helps
you can try this
No of days =interval((date1- date2), 'dd')
-Raghu
Hi Raghu,
I have used interval. While it works 'standalone' when I use an 'and' it brings "havoc"...
if
(interval(('$(MyDate)'- [Due Date] ), 'dd') <=30,'0-30days') as AgeingDD,if
(interval(('$(MyDate)'- [Due Date] ), 'dd') >30 and interval(('$(MyDate)'- [Due Date] ), 'dd') <=60,'31-60days') as AgeingDD;why??