Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tripatirao
Creator II
Creator II

Date And Date# function

Hi

I want to know about difference between  Date and Date# function .

Thanks

1 Solution
5 Replies
qlikviewwizard
Master II
Master II

Hi,

Please check the attached screens and script.

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Data:

Load *, date(date#(Trans_Date,'YYYYMMDD'),'DD-MMM-YYYY') as Another_Required_Date_Format; // convert the date to DD-MMM-YYYY

load *,date(date#(Trans_Date,'YYYYMMDD'),'DD/MM/YYYY') as Required_Date_Format;/// conevrt the date to DD/MM/YYYY

LOAD * ,DATE#(Trans_Date,'YYYYMMDD') AS Real_Trans_Date;  ///converted to date to same format YYYYMMDD

load  *  inline [

Trans_Date

20140125

20140205

20140329

20140415

20140520

];

Capture.PNGCapture1.PNG

prma7799
Master III
Master III

SreeniJD
Specialist
Specialist

In Simple words...

Date# will be useful to convert the string to different date format

Date will be restricted to convert a date to another date format.

HTH

Sreeni

Not applicable

Date() converts date to the required format. Also, it stores a date as number in the back-end and show you as a date

Qlikview is intelligent to find date field and covert to date format during the load. Incase Qlikview did not recognize the format and treats data type as a string. Date#() is used to help Qlikview interpret it as a date format.