Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

hopkinsc
Valued Contributor

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

Change a MINUS to POSITIVE

write

sum(SalesValue)*-1

hopkinsc
Valued Contributor

Change a MINUS to POSITIVE

Excellent, thanks very much.

Not applicable

Change a MINUS to POSITIVE

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

/Martin

suniljain
Honored Contributor

Change a MINUS to POSITIVE

multiply minus value by -1.