Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tahreen371
Contributor III
Contributor III

to replicate data from one column to another with minus sign

Hello all,

I have one column as Amount and i need to replicate a new Column called Payment  with every value in amount column is not positive

And all the values in Payment  column should have Negative sign before it.

And refer 2nd example where the value for 2nd value in amount column is already negative but still it should show just negative

AmountColumn
2052233.32-2052233.32
2618346.33-2618346.33
3784029.68-3784029.68
  
8454609.33-8454609.33
  
2052233.32-2052233.32
-2618346.33-2618346.33
3784029.68-3784029.68

 

Labels (1)
  • NA

2 Solutions

Accepted Solutions
OmarBenSalem

- fabs(Column1) as column2

View solution in original post

tresesco
MVP
MVP

Fabs(Amount)*(-1) as Column

View solution in original post

4 Replies
OmarBenSalem

- fabs(Column1) as column2

tresesco
MVP
MVP

Fabs(Amount)*(-1) as Column
santhiqlik
Creator
Creator

Hi,

This can be achieved using sign() in script as follows

Load

     Amount,

     If(Sign(Amount)=1,Num('-' & Amount),Amount) as Payment // Sign() returns 1 for positive values

From Table;

Let me if this helps !!

--Priya

tahreen371
Contributor III
Contributor III
Author

Hello All,

 

I aslo tried with this script:

if(num(AMOUNT)>0,num(AMOUNT)*-1, AMOUNT_IN_LC_TEMP) as Payment

It worked and thank you for quick response