4 Replies Latest reply: Aug 3, 2013 3:22 AM by Tresesco B

# How num function works for date format.

Hi All,

if we add num function with current date  then it will display some random amount..

Is there anyone to help me regarding the logic implemented in QlikView to calculate the amount.

=num(today())

• ###### Re: How num function works for date format.

if you use this function today i.e 03-08-2013, you will get an integer say x. then for the same function combination tomorrow (04-08-2013) you will get x+1 and for day after tomorrow x+2 and so on.

• ###### Re: How num function works for date format.

Thats the question...

from where it takes values x ...

How it will calculate value of x

• ###### Re: How num function works for date format.

QV Stores dates as serial numbers similar to the case of Excel.

I hope the below link helps  you understand better :

http://community.qlik.com/servlet/JiveServlet/previewBody/3102-102-3-4191/DateFields-TechBrief-US_v2.pdf

• ###### Re: How num function works for date format.

This is 1900 Date system:

• If year is between 0 (zero) and 1899 (inclusive), Excel adds that value to 1900 to calculate the year. For example, `DATE(108,1,2)` returns January 2, 2008 (1900+108).
• If year is between 1900 and 9999 (inclusive), Excel uses that value as the year. For example,`DATE(2008,1,2)` returns January 2, 2008.
• If year is less than 0 or is 10000 or greater, Excel returns the #NUM! error value.

Hope this helps