Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

What does SET DateFormat='M/D/YYYY'; in the data load editor script do?

I see that there is SET DateFormat='M/D/YYYY'; line the data load editor script -- I am curious to learn what it does? I had a hypothesis that it formats all fields (from the load section) with "date" datatype to M/D/YYYY format. But that doesn't seem to be true.

Thanks in advance for your help.

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: What does SET DateFormat='M/D/YYYY'; in the data load editor script do?

Not sure how the SQL works, but may be do this and see if it helps:

LOAD Date(mydate) as mydate;

Select cast('10/16/2016' as date) "mydate";

3 Replies
MVP
MVP

Re: What does SET DateFormat='M/D/YYYY'; in the data load editor script do?

It defaults the format used when you use Date() function. and if you data source has the same format as the one you set up top, QlikView will be able to recognize it as date and bring it as a date field instead of text.

Not applicable

Re: What does SET DateFormat='M/D/YYYY'; in the data load editor script do?

Thanks for the reply. So I tested it using a SQL command in the data load editor:

select cast('10/16/2016' as date) "mydate";

Note that the datatype is "date"...but the app is not picking the format M/D/YYYY:

Not picking up the date format.PNG

Any ideas?

MVP
MVP

Re: What does SET DateFormat='M/D/YYYY'; in the data load editor script do?

Not sure how the SQL works, but may be do this and see if it helps:

LOAD Date(mydate) as mydate;

Select cast('10/16/2016' as date) "mydate";

Community Browser