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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

CSV Dates

Hi,
I am importing CSV files and have two date columns. In my CSV the two columns show numbers (43705, 45673, etc...). I am designating the two columns as Strings in the tFileInputDelimited and using tConvert to convert two strings into integers and then in tMap I am using routines.TalendDate.parsedate("MM/dd/yyyy", row1.Source) and routines.TalendDate.parsedate("MM/dd/yyyy", row1.Week) it still shows an error.

0683p000009MG96.png

Exception in component tMap_1
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "42715"
at routines.TalendDate.parseDate(TalendDate.java:895)
at routines.TalendDate.parseDate(TalendDate.java:839)
at rehearsalproject.infocsv_0_1.infocsv.tFileInputDelimited_1Process(infocsv.java:2369)
at rehearsalproject.infocsv_0_1.infocsv.runJobInTOS(infocsv.java:3084)
at rehearsalproject.infocsv_0_1.infocsv.main(infocsv.java:2941)
Caused by: java.text.ParseException: Unparseable date: "42715"
at java.text.DateFormat.parse(Unknown Source)
at routines.TalendDate.parseDate(TalendDate.java:881)
... 4 more
[statistics] disconnected

Labels (2)
13 Replies
Anonymous
Not applicable
Author

Thanks Harkirat,
I want the date format MM/dd/yyyy as 12/31/2016. But I thought parseDate(String ----> Date) can be used here. So if I have 100 csvs I have to rectify all the date formats for all the csvs. Is there anyway I can have string as data type in tfileinputdelimited and in tmap do TalendDate.parsedate("MM/dd/yyyy".row1.MyDate) for all the date values? Manually formatting ALL the csvs to the proper date format will be quiet an hassle.
Anonymous
Not applicable
Author

Hi Sabrina,

Can you help me with my problem please? I am facing difficulties converting data types.
Anonymous
Not applicable
Author

When I MANUALLY change the number format to short date in the csv.

It does not display corresponding date if I change the number of format to a short date, the number 42722 does not match any date format, so it can not be parsed to a date. 
Regards
Shong
Anonymous
Not applicable
Author

Thanks Sabrina, for being explicit with me.