Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date() vs Date#()

Can someone illustrate the difference between the two?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Date#() is used how to interpret the data.  For example

date#('2013_24_10','YYYY_DD_MM') tells that the first four digits are year, the digits between two '_'s are Date, and the last two are Month.

Date() is used to tell how to show the data.  For example

date(today(),'YYYY_DD_MM') returns  2013_24_10

date(today(),'MM/DD/YY') returns  10/24/13

Combination of both:

date(date#('2013_24_10','YYYY_DD_MM'),'MM/DD/YYYY') returns 10/24/2013

Regards,

Michael

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Date#() is used how to interpret the data.  For example

date#('2013_24_10','YYYY_DD_MM') tells that the first four digits are year, the digits between two '_'s are Date, and the last two are Month.

Date() is used to tell how to show the data.  For example

date(today(),'YYYY_DD_MM') returns  2013_24_10

date(today(),'MM/DD/YY') returns  10/24/13

Combination of both:

date(date#('2013_24_10','YYYY_DD_MM'),'MM/DD/YYYY') returns 10/24/2013

Regards,

Michael

Not applicable
Author

Very helpful.  Thanks!

Not applicable
Author

I have an issue with date() and date#(),i have field called ActionDate which is in this format 'DD/MM/YYYY'

and I have a field in the script  that calculates DDMM  like this

date#(date(CalendarDate,'DDMM'),'DDMM') Do you think there is a redundancy in this expression? thank you

MK_QSL
MVP
MVP

You can read this useful document.

Not applicable
Author

Thank you for your help Manish.

Not applicable
Author

thank you it was a nice Demo

Not applicable
Author

use this document which is very helpful