# How to convert negative values to positive in adf

Anonymous
2022-06-09T08:39:37.92+00:00

I'm loading source files to stage table. By using data flow activity. I have few negative values in my xl file. So how to convert negative values to positive by using derived column transformation in Azure Data Factory.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,357 questions

1. 32,161 Reputation points Microsoft Employee
2022-06-10T10:10:39.66+00:00

Hi @Rohith-0358 ,
Welcome to Microsoft Q&A platform and thanks for posting your query.

As I understand your ask here, you want to convert negative int values to positive using ADF . As correctly mentioned by @Nandan Hegde and @Samy Abdul , you can use abs function in derived column transformation in the mapping data flow to achieve this requirement.

To reproduce your scenario, I created a table having a column 'num' which contains negative records .

Used Derived column transformation to make change in existing column using expression `abs(toInteger(byName('num')))`

Here is the result,

Hope this will help. Please let us know if any further queries.

------------------------------

• Please don't forget to click on or upvote button whenever the information provided helps you.
Original posters help the community find answers faster by identifying the correct answer. Here is how
• Want a reminder to come back and check responses? Here is how to subscribe to a notification
• If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

1. 31,766 Reputation points MVP
2022-06-09T08:41:01.977+00:00

2. 3,366 Reputation points
2022-06-09T08:49:35.403+00:00

Hi @Rohith-0358 , please use negate function:

abs
abs(<value1> : number) => number

Absolute value of a number.

abs(-20) -> 20
abs(10) -> 10

negate
negate(<value1> : number) => number

Negates a number. Turns positive numbers to negative and vice versa. Thanks

negate(13) -> -13 Thanks