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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date format issues in load script

Hi

I have a spreadsheet with the date data as 3/16/2015 (to be read M/DD/YYYY)

How can I format this in the load script to load in as DD/MM/YYYY so each month will be a double digit number?


1 Solution

Accepted Solutions
sunny_talwar

gwassenaar does the order of Date#(Date(...)) matter? I feel that shouldn't the second MyNewDate be like this?

LOAD

    Date(Date#(MyExcelDate, 'M/DD/YYYY'),'DD/MM/YYYY') as MyNewDate

FROM ....

Let me know if it doesn't matter.

Best,

Sunny

View solution in original post

8 Replies
Anonymous
Not applicable
Author

change the script:

Date( YourTimeDimension,  'DD/MM/YYYY') as YourTimeDimension,

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Excel dates are often already numeric values with date formatting. In that case you only need the date() function:

LOAD

     date(MyExcelDate, 'DD/MM/YYYY') as MyNewDate

FROM ....

But if the excel values are string values then you also need the date#() function:

LOAD

     date(date#(MyExcelDate, 'M/DD/YYYY'),'DD/MM/YYYY') as MyNewDate

FROM ....


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

Date(Date#(DateField,'M/DD/YYYY'),'DD/MM/YYYY')  as DateField

avinashelite

Refer to this document for the date formatting

sunny_talwar

gwassenaar does the order of Date#(Date(...)) matter? I feel that shouldn't the second MyNewDate be like this?

LOAD

    Date(Date#(MyExcelDate, 'M/DD/YYYY'),'DD/MM/YYYY') as MyNewDate

FROM ....

Let me know if it doesn't matter.

Best,

Sunny

Anonymous
Not applicable
Author

Many thanks!! Date(Date#.......worked like a charm!!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Yes, you're totally right. Thanks for pointing out my error.


talk is cheap, supply exceeds demand
sunny_talwar

That was more sort of a question than to point out your error. But I am glad it served both the purposes

Best,

Sunny