Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone please advise me below issue? Thanks a lot! -
My purpose was to compare if "ETD" is later than "ETA Port" in string data type
I changed my schema to show "string" for two dates, and then I wrote syntax - ETD.compareTo(ETA_to_Discharge_Port)>0
I think my syntax is correct to compare two strings (please correct me if I am wrong) and then I got below output which ETD is earlier than ETA Port
Hello @szhou1 ,
Quite new here but if I can try to help : Did you try to use TalendDate.compareDate() & FormatDate() ?
Check here : https://help.talend.com/reader/~R4Lk_SlELw9a8pKBKTm9A/JFWl8U3lEbhWZEFAUtYvMw
Cheers
Hi, I think you can not compare to dates in string format. May be you can use variable ports in tMap to convert input string to date temporarily and compare dates. for output you can use input string values.
Regards,
Hi,
I changed into "date" data type and used syntax - TalendDate.compareDate(BKGerrors.ETD, BKGerrors.ETA_to_Discharge_Port)>0
and I got below output -
I checked the source data and find that the output is incorrect because the source for ETD should be below
not sure why I got 5/2/2019 which is totally different from the source
Hi,
I created variable to convert string to date and compare. and I got below errors -
Please try below
From the source 4th record rejected because of ETD>ETA.
Regards,
Hi,
Thank you for the help!
Can you please explain in detail why you use tfixrowinput? I am new on Talend so not quite understand...
The flow I build is below
tFixedFlowInput used to create sample data.
Regards,