Replace $ in SalesData Column

Eight Stars

Replace $ in SalesData Column

I have a Column Where SalesData is coming. Now with Numbers in start of the data $ is coming. as well as some Data is having value like "$-" which I have to replace with "UNK" otherwise as it is. Now I am trying with replaceall in tmap variableport.Both can be handled in One tmap VariablePort?

Sample Data

$10700.50

$-

@rhall_2_0@TRF@manodwhb@vboppudi


Accepted Solutions
Nine Stars

Re: Replace $ in SalesData Column

row2.Amount.equals("$-")?"UNK":row2.Amount.replaceAll("[^\\d.]", "") 

 

Regards,

Veeru Boppudi

All Replies
Nine Stars

Re: Replace $ in SalesData Column

Yes, you can handle both in tMap variable ports.

 

Regards,

Veeru Boppudi
Eight Stars

Re: Replace $ in SalesData Column

In One Variable Port I want to do. I am doing like this now:

row1.COLUMN.replaceAll("$","")=="$-"?"UNK":row1.COLUMN.replaceAll("$","").But not working. @vboppudi

Nine Stars

Re: Replace $ in SalesData Column

try below one

Replace$.PNGReplace$1.PNG

Regards,

Veeru Boppudi
Eight Stars

Re: Replace $ in SalesData Column

Hi @vboppudi,

Can You please write the replaceall part?It's almost impossible to read

Nine Stars

Re: Replace $ in SalesData Column

row2.Amount.equals("$-")?"UNK":row2.Amount.replaceAll("[^\\d.]", "") 

 

Regards,

Veeru Boppudi
Eight Stars

Re: Replace $ in SalesData Column

Yes.It's perfectly working.Thanks a lot @vboppudi Smiley Happy 

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

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