6 Replies Latest reply: Aug 30, 2017 8:09 AM by Jonathan Dienst

# how to get number of days from the difference of two dates in qliksense??

I want to calculate number of days from the difference of two dates i.e 23-08-2017 and 24-02-2017   in Load Editor of qilksense.

Kindly help.

• ###### Re: how to get number of days from the difference of two dates in qliksense??

Hi,

Try like this,

interval(date1-date2,'D')  as Days

Regards,

• ###### Re: how to get number of days from the difference of two dates in qliksense??

but its giving 180 days but it should be 181 days.

• ###### Re: how to get number of days from the difference of two dates in qliksense??

interval(date1-date2+1,'D')

• ###### Re: how to get number of days from the difference of two dates in qliksense??

Still not getting right answer because 23-08-2017 minus 23-08-2017 has to be 0 but +1 makes it 1 which is not correct.

Kindly give the alternate option.

• ###### Re: how to get number of days from the difference of two dates in qliksense??

check this,

if(date1=date2,interval(date1-date2,'D'),interval(date1-date2+1,'D'))

• ###### Re: how to get number of days from the difference of two dates in qliksense??

Do you want the interval to be inclusive (23-08-2017 and 24-02-2017 = 181), or exclusive ( 23-08-2017 minus 23-08-2017 has to be 0)

Inclusive 181 and 1

Exclusive 180 and 0