Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Regarding date difference

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

5 Replies
Not applicable
Author

Hi,

No. date. = [Payment recieved date] - [Invoice Generated Date ]

this will do.

-Sridhar Yes


Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

you can try this

No of days =interval((date1- date2), 'dd')

-Raghu

Not applicable
Author

Hi Raghu,

I have used interval. While it works 'standalone' when I use an 'and' it brings "havoc"... Angry

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??