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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
tnewbie
Creator II
Creator II

Talend - Date Conversion issues!!!

Hello All,

I have comma delimited flat file as my source with row structure as 

cust_number

cust_name

cust_age

cust_gender

cust_height

cust_registered_date

001

Rado

25

M

5.4

01-jan-2015

002

John

65

M

4.9

10-nov-2016

 

my requirement is to convert the cust_registered_date into yyyy/mm/dd format and populate a target flat file after few more derivations on the other fields....i am having issues with converting this cust_registered_date to any other format....read through as many posts as possible on the community and below is all i did, but with no success

1) Tried this conversion using TalendDate.parsedate, formatdate

2) Tried putting my input column data type to String, Date, similarly tried changing  variable port data type to string, date 

3) Tried using the formats yyyy-MMM-dd, yyyy-mmm-dd,yyyy-mon-dd 

4) Tried putting single quotes, double quotes, without quotes to the incoming values in the src file

 

My requirement if put in Sql would be a one liner:

to_date(cust_registered_date,'yyyy-mon-dd')

 

can any please help

 

Labels (1)
6 Replies
Anonymous
Not applicable

Hello,

What's your input source data type? String or Date?If you need parse String to Date:

The expression should be :TalendDate.parseDate("dd-MM-yyyy",cust_registered_date).

0683p000009M5My.png

Best regards

Sabrina

 

fdenis
Master
Master

I'had got the same trouble. I solved it by splitting date into tmap and recreate it from number(if 'jan' then 01)
tnewbie
Creator II
Creator II
Author

Hi fdenis,

 

Can you elaborate your approach with screen shots please

tnewbie
Creator II
Creator II
Author

Thanks Sabrina.

I think the format differences you highlighted in the expression editor and the schema date pattern are not typos but intentional...if Yes, then this is something interesting that i have to check. Will Let you know if that works

manodwhb
Champion II
Champion II

@tnewbie , just replace the below expression in  @xdshi  screenshot.

 

TalendDate.parseDate("dd-MMM-yyyy",row1.date)


yyyy/mm/dd

Anonymous
Not applicable

Hi,

 

I need to load data from excel(.xls) to table. In my file date column format is dd/mm/yyyy and I want in same format.

But I am getting result as -

29-12-0020 00:00:00  instead of 29-12-2020 00:00:00 

 

I am using in tmap -  TalendDate.parseDate("dd/MM/YYYY",row1.start_date)

I don't want to manually format my column in file as it will be going automated process. Hence in input, I putted type as string.

 

Could you please help me with this ?

 

Thanks,