How to convert negative values to () brackets

Four Stars

How to convert negative values to () brackets

How to convert negative values to () brackets.

-7 to (7)

And i have columns with null values and i need that to insert as null and it should not throw any null error

 

 SRC

ColA  ColB

          2

-1       -7

TGT -- Output

ColA  ColB

          2

(1)     (7)

Highlighted
Thirteen Stars

Re: How to convert negative values to () brackets

@ravi777,try this one

(!row3.newColumn1.equals("") || row3.newColumn1!=null) &&row3.newColumn1.contains("-")?"("+row3.newColumn1.replace("-","")+")": row3.newColumn1 

Manohar B
Thirteen Stars

Re: How to convert negative values to () brackets

@ravi777,still do you have this issue?

Manohar B

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.