Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is there an easy way of changing a MINUS figure to a positive figure in an expression?
I have to use an expression to calculate a column. I am calculating 2 fields (SalesValue and RSPValueDiff)
SalesValue = the price the product was sold for
RSPValueDiff = The difference between the current RSP (standard price) and the SalesValue (the Actual selling price)
I have not got a field which gives me the RSP, so i am trying to calculate it by adding the 2 fields above together. the problem i have is that the RSPValueDiff is a MINUS figure.
E.g.
Coca cola sold for 0.55 pence (SalesValue) which is -0.20 pence lower than the RSP (RSPValueDiff) . but if i add both fields up, i would get 0.35 Pence, when it should add up to 0.75 pence.
How can i calculate the RSP correctly?
write
sum(SalesValue)*-1
Excellent, thanks very much.
Try fabs(SalesValue) - this will make all numbers absolute values (no negative values)
/Martin
multiply minus value by -1.