Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Amount | Column |
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 |
- fabs(Column1) as column2
- fabs(Column1) as column2
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
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