tconverttype component problem

Eight Stars RAJ
Eight Stars

tconverttype component problem

Hi Folks,

  

I have 75 rows are there in my excel.          

In my excel have reject records. so I fixed all the columns datatype are string for metadata

Then I used tconverttype component for string to double.

I have tried but two records missing.

The tconverttype component not convert string to double properly.

is there any other way to solve this issue. Please kindly share your information. 

Thanks
RAJ
Moderator

Re: tconverttype component problem

Hello,

What does the missing two records look like?

Would you mind posting your job design screenshots on forum so that we can check it to see if it is a bug for tConvertType component.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: tconverttype component problem

SUppose our data has commas in between then it fails to read it as double. sometimes even the negative sign.
Eg: -32,987,987
This value wont be read by tconverttype.
is there any bug? or can we avoid this?

Thanx
Employee

Re: tconverttype component problem

@Aishwarya,

 

       You will have to clean your data by removing comma before applying the type conversion. Comma is added to a number for readability purpose but it will create problem while type conversions.

 

      Could you please use java replace command to remove all comma with empty string and then try to convert the string?

 

      If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome :-)

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Forteen Stars

Re: tconverttype component problem

@Aishwarya,Yes as suggested by @nikhilthampi, first remove the special charters,if you have by using removeall function in java,that you can use in tJavarow or tMap,based on the way and then covert from sting to double it will work.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: tconverttype component problem

Can you tell me the formula to remove all comas? //D removes other characters like negative sign and percentage
Employee

Re: tconverttype component problem

@Aishwarya,

 

    Please use the below function in tmap to convert comma to empty string. 

 

row1.input.replaceAll(",", "")

 

    If the answer has helped you to resolve the issue, could you please mark the topic as closed? Kudos are also welcome :-)

 

Warm Regards,

 

Nikhil Thampi


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch