Reporting Services 中的 iif 语句仅包含组中的值

发布于 2024-08-13 14:42:17 字数 420 浏览 4 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

停顿的约定 2024-08-20 14:42:17

问题是您只想将组的名称放在聚合函数的最末尾。切换到这种格式解决了我的问题:

=Sum(iif(Fields!Repeat.Value = "*", 0, Fields!Hours_Earned.Value), "Departments")

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:

=Sum(iif(Fields!Repeat.Value = "*", 0, Fields!Hours_Earned.Value), "Departments")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文