Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

To calculate No of days

Dear All

i have two Dates OrderDate and Delivery date

orderdate              product                          Delivery date

01/02/2014               X                                   10/02/2014

  01/02/2014               Z                                    11/02/2014

01/02/2014               A                                    12/02/2014

01/02/2014               B                                    15/02/2014

02/02/2014               X                                   11/02/2014

Now i want to calculate number of days , output should be  No Of days = 15 days

How can i calculate No of Days, & what is the logic??

6 Replies
Anonymous
Not applicable

interval(date(date#([Delivery date]), 'MM/DD/YYYY') - date(date#(orderdate), 'MM/DD/YYYY'),'D')

abhaysingh
Specialist II
Specialist II
Author

not working..... and what does that 'D' represent for??

senpradip007
Specialist III
Specialist III

Try like

Interval(date(date#('10/02/2014', 'DD/MM/YYYY'), 'DD/MM/YYYY') - date(date#('01/02/2014', 'DD/MM/YYYY'), 'DD/MM/YYYY'),'D')

Here 'D' stands for number of days.

Anonymous
Not applicable

D represents output in days. see attached.

ps: i suggest looking up the functions used here in help. there are examples and other possible parameters listed as well.

sasikanth
Master
Master

hi,

if you want in a text object

='No of days ='&Interval(Delivery date-orderdate ,'D')

diegofcaivano
Partner - Creator
Partner - Creator

Substracting two date field values will automatically give you the difference in days, because of how QlikView handles dates as integer numbers (julian calendar).

Just make sure you have both fields properly set, using DATE and DATE# functions as needed.