Reporting Services 中的 iif 语句仅包含组中的值
在 Reporting Services 2005 中,我创建了一个表,其中包含几个组。我想在组中的一列上执行基本的 iif()
,尽管 Intellisense 说我正在正确格式化我的 iif()
,当我转到预览报告 我被告知我缺少虚假部分。此外,Value 后面的“,”带有下划线,表示语法错误。
=Sum(iif((Fields!Repeat.Value, "Departments") = "*", 0, Fields!Hours_Earned.Value))
我正在合作的小组称为“部门”,并且有一个 nvarchar 列,其中偶尔有一个星号。如果该组的该列中的任何位置有星号,我希望显示 0 等。有什么想法吗?似乎第一个“,”被误解为 iif() 中表达式的结尾,但事实并非如此,它位于括号内。
In Reporting Services 2005 I have created a table that has a few groups in it. I would like to perform a rudimentary iif()
on one of the columns in the group and though the Intellisense says I am formatting my iif()
correctly, when I go to preview the report I am told I am missing my false part. In addition, the ',' after Value is underlined as a syntax error.
=Sum(iif((Fields!Repeat.Value, "Departments") = "*", 0, Fields!Hours_Earned.Value))
The group I am working with is called "Departments" and there is a nvarchar column that occasionally has a asterisk sign in it. If there is an asterisk anywhere in that column for this group, I want a 0 to be displayed, etc. Any ideas? It seems as though the first ',' is being misconstrued to be the ending of my expression in the iif()
, but it is not, and it is inside parentheses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是您只想将组的名称放在聚合函数的最末尾。切换到这种格式解决了我的问题:
The problem is that you only want to place the name of the group at the very end of the aggregation function. Switching to this format solved my problem: