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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Convert the BigDecimal Value into Date format

Hi,
I am using Talend Data Integration Tool (5.3.1r104014), i would like to integrate the data from Source database to destination data base with using tmap_1 component, the source and destination are MSSQL.
So From the source data base they define the date format like this 20101109(i.e. data type is Bigdecimal), but in the destination the date format is dd/mm/yyyy (i.e. data type is date).
I am unable to convert the Bigdecimal value into Date format and unable to give the null value.
Code:
TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("yyyyMMdd",row1.newColumn.toString())))
When i am execute the above mentioned code in the Expression Builder, the result is "Exception in component tRowGenerator_1" appear.
And also i am unable to give the null date format like "12/31/1599" , Please find the attached screen shot.
Please help on the above two issues
Thanks in advance
Siva
0683p000009MEUy.png
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
According to your request, you need to convert null to a fixed date, before inserting it to target database, for example:
row1.newColumn==null?TalendDate.parseDate("MM/dd/yyyy", "12/31/1599"):TalendDate.parseDate("yyyyMMdd",row1.newColumn.toString())
And set the data type of this column as Date in the output table of tMap.
Shong

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Hi,
When i am execute the above mentioned code in the Expression Builder, the result is "Exception in component tRowGenerator_1" appear.

The Test! button can't understand row2.AUDIT if the expression refers to a column value, you need to execute the job to see if the job works without any compilation error or Java error, we usually use the Test! button to test a function, as the screenshot showed.
Best regards
Sabrina
0683p000009MEhR.png
Anonymous
Not applicable
Author

Hi Sabrina,
Thank you for the information,
I would like to pass the null date like "12/31/1599", Is there any possibility to pass the null date,
Please let me know, what is the function to pass the null date value.
Thanks in Advance
Siva
Anonymous
Not applicable
Author

Hi,
Do you mean convert the null string or empty into 12/31/1599 by default?
Such as:
Input source:
12/04/2011;
null;
;
08/23/2012;
Expected result:
12/04/2011;
12/31/1599;
12/31/1599;
08/23/2012; ?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
When i give the input as 12/04/2011; i have faced the first screen error data type mismatch.
if i give the input null; the second screen shot error appear.
So what i am expected, i want a null date to pass the destination columns like 12/31/1599.
Please help us
Thanks
Siva
0683p000009MEv7.png 0683p000009MEvC.png
Anonymous
Not applicable
Author

Hi
According to your request, you need to convert null to a fixed date, before inserting it to target database, for example:
row1.newColumn==null?TalendDate.parseDate("MM/dd/yyyy", "12/31/1599"):TalendDate.parseDate("yyyyMMdd",row1.newColumn.toString())
And set the data type of this column as Date in the output table of tMap.
Shong
Anonymous
Not applicable
Author

Hello i'm when i'm convert unix date to readable date i got the default value for the timestamps date any help 0683p000009MACn.png?
Anonymous
Not applicable
Author

Hello i'm when i'm convert unix date to readable date i got the default value for the timestamps date any help 0683p000009MACn.png?

Take a look at a related topic:
https://community.talend.com/t5/Design-and-Development/resolved-Unix-date-to-normal-date-tmap/td-p/9...
If you still have problem, please describe your problem with more details.
Shong
Anonymous
Not applicable
Author

How to convert null into new BigDecimal?
Anonymous
Not applicable
Author

How to convert null into new BigDecimal?

Can you please explain your requirement with more details? Are you getting error when convert a column data to BigDecimal type?
Best regards
Shong