Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Change a MINUS to POSITIVE

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?

4 Replies
Not applicable

write

sum(SalesValue)*-1

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Excellent, thanks very much.

Not applicable

Try fabs(SalesValue) - this will make all numbers absolute values (no negative values)

/Martin

suniljain
Master
Master

multiply minus value by -1.