Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

New Contributor II

Date # working.

Hello Everyone,

I have q query with the date# function

DATE_1 = 20150904

DATE_2 = 20160711

Date#(DATE_1,'YYYYMMDD')-Date#(DATE_2,'YYYYMMDD') = output value is shown as -329 .

But when we do it manually :20150904 – 20160711           = -9807 .

Can any once please tell how -329 is coming.

Thanks in Advance!


Supriya Dornala.

4 Replies

Re: Date # working.

Are you looking for mathematical difference or date difference? Because -329 is the number of days difference between the two dates and 9807 is the mathematical difference. These two calculations are very different from each other.

Esteemed Contributor II

Re: Date # working.

so beginning of the year 2015 is 20150101 and 20160101  will give a difference of 10,000 days!   you are subtracting numbers this way not dates!!

New Contributor II

Re: Date # working.

Hello All,

Thanks for correcting me.

I can say it as my blunder mistake. I have take the date format values to excel sheet and converted into it number format values (which QlikView is doing). After performing the conversion and calculating the values gives the correct result.

Thank You

Re: Date # working.

Glad that it got resolved. Please close this thread by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful



Community Browser