Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
swati_rastogi27
Creator
Creator

Unable to override default date format in load script

I want the date format to be 'DD-MMM-YYYY' , but no matter what conversion i apply , I am unable to change it.

The format that appears is 'M/D/YYYY' along with timestamp 12:00:00

date_format.PNG

I tried DATE(DATA_DATE,'DD-MMM-YYYY')AS DATA_DATE in the load script

I also tried to set default date format

SET DateFormat='DD-MMM-YYYY';

None of this seems to work

9 Replies
arulsettu
Master III
Master III

try this

date(Date#(datefield,'D/M/YYY hh:mm:ss tt'),'DD-MMM-YYYY')

Anonymous
Not applicable

or may be something  like this?

DATE(FLOOR(Date#(DateField,'DD-MMM-YYYY')),'DD-MMM-YYYY') AS NEWDATE

What is your Data source?

sunny_talwar

How about this:

Date(Floor(DATA_DATE)) as DATA_DATE

swati_rastogi27
Creator
Creator
Author

My data source is Oracle where the standard format is defined as 'DD-MMM-YYYY'

swati_rastogi27
Creator
Creator
Author

Using Date# gives null result

Anonymous
Not applicable

then try timestamp#() instead of Date#()

swati_rastogi27
Creator
Creator
Author

1.     I picked up DATA_DATE from Oracle, stored in a TEMP table

2.     Did resident load on TEMP table , changing the date format

     date(DATA_DATE,'DD-MMM-YYYY') AS DATA_DATE

3.     Stored in QVD

When I read from this QVD, again the format in my table box appears as M/D/YYYY 12:00:00 AM

t_moutault
Contributor III
Contributor III

hi,

try this :

Date(Date#(SubField(DATEFIELD,' ',1),'D/MM/YYYY'),'DD/MMM/YYYY')

or

Date(timestamp#('1/12/2016 10:35:21 AM','D/MM/YYYY hh:mm:ss tt'),'DD/MMM/YYYY')

Anil_Babu_Samineni

Swati, You are saying you are fetching from qvd - So, Would you be able to provide sample

1.     I picked up DATA_DATE from Oracle, stored in a TEMP table

2.     Did resident load on TEMP table , changing the date format

     date(DATA_DATE,'DD-MMM-YYYY') AS DATA_DATE

3.     Stored in QVD

When I read from this QVD, again the format in my table box appears as M/D/YYYY 12:00:00 AM

1) How DATE_DATE looking?

2) date(date#(DATA_DATE,'YourDateFieldFormat'),'Required Format') AS DATA_DATE

Then Try

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful