简体   繁体   English

如何在SRS中删除表达式中值的负号

[英]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 或者,如果您确实想消除负号,则使用Absolute -不管该值是否为正数

Abs(<expression>)

I would also remove the formatting part of the expression and put that into the Format property. 我还将删除表达式的格式化部分,并将其放入Format属性中。 Almost everything in SSRS can be an expression, so you don't have to do everything in the Value expression. SSRS中的几乎所有内容都可以是一个表达式,因此您不必在Value表达式中做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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