Reporting services microsoft报表生成器中的IIF

Reporting services microsoft报表生成器中的IIF,reporting-services,iif,Reporting Services,Iif,我需要在micorsoft report builder中的以下表达式中插入IIF,我不断收到一个错误。我想让它说如果>1,1,“” =Round((Fields!percent\u excellent.Value+Fields!percent\u good.Value)*100,0)和“%”(((Fields!percent\u excellent.Value+Fields!percent\u good.Value)-Fields!peer\u group.Value)*100,0)和“%”我

我需要在micorsoft report builder中的以下表达式中插入IIF,我不断收到一个错误。我想让它说如果>1,1,“”


=Round((Fields!percent\u excellent.Value+Fields!percent\u good.Value)*100,0)和“%”(((Fields!percent\u excellent.Value+Fields!percent\u good.Value)-Fields!peer\u group.Value)*100,0)和“%”我不知道您尝试了什么,但这应该有效:

=IIF(Round((Fields!percent_excellent.Value + Fields!percent_good.Value) * 100,0) > 1,
    100, 
    Round((Fields!percent_excellent.Value + Fields!percent_good.Value) * 100,0)) & 
"% (" & Round(((Fields!percent_excellent.Value + Fields!percent_good.Value) - Fields!peer_group.Value) * 100,0) & "%)"
我认为最好使用FORMATPERCENT将数字格式化为一组小数位数,并添加百分号

=FORMATPERCENT(
    IIF(
        (Fields!percent_excellent.Value + Fields!percent_good.Value) * 100 > 1, 
            1, 
            (Fields!percent_excellent.Value + Fields!percent_good.Value) * 100
        )
    , 0) & " ("
 FORMATPERCENT(((Fields!percent_excellent.Value + Fields!percent_good.Value) - Fields!peer_group.Value) * 100, 0) & ")"

欢迎来到SO!我认为您可以提高获得答案的机会,更好的方法是不在表达式中进行任何格式化,只在文本框的format属性中使用
“p0”
<代码>“p0”将值
0.1234
显示为
12%
,类似于
“p2”
的东西将以2位小数显示相同的值,即
12.34%
显示为百分比不是问题。我从调查中下载了数据,并输入了回复。这两个数字加起来超过100(101%)。我希望它在大于1(100%)的情况下执行,然后是1,否则它应该是什么。使用下面的返回值1=IIF(舍入((字段!percent_Excellence.Value+字段!percent_good.Value)*100,0)>1,1,”&“((字段!percent_Excellence.Value+字段!percent_good.Value)-字段!对等组值)*100,0)&“%)@AlanSchofield-在本例中,他无法使用文本框格式属性-一个文本框中有两个不同的值(即
75%(12%)
)。@Stasia-您不会显示
percent\u excellent
percent\u excellent
的值。我在想也许你不应该把它们乘以100。