简体   繁体   中英

How to remove the negative symbol for values in expression in ssrs

FormatCurrency(
(SUM(iif(IsNothing(Fields!Planned.Value),0,Fields!Planned.Value))-(SUM(iif(IsNothing(Fields!Actuals.Value),
iif(IsNothing(Fields!Forecasts.Value),0,Fields!Forecasts.Value),
iif(Fields!Actuals.Value=0,iif(IsNothing(Fields!Forecasts.Value),
0,
Fields!Forecasts.Value),Fields!Actuals.Value))))),
iif(Parameters!DecimalDigits.Value=1,1,iif(Parameters!DecimalDigits.Value=2,2,0)),0,0,0)
)

this is my expression which is returning negative values and how to remove this negative sign in front of the number

The easiest way is to turn the expression around. For instance, if

Planned - Actual

is giving you negative numbers and you want positive numbers then maybe you want

Actual - Planned

Otherwise you could just take the whole expression away from zero to reverse the sign:

0 - <expression>

Or if you really want to kill the negative sign regardless, then use Absolute - this returns the value as a positive number regardless

Abs(<expression>)

I would also remove the formatting part of the expression and put that into the Format property. Almost everything in SSRS can be an expression, so you don't have to do everything in the Value expression.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM