简体   繁体   English

SSRS 表达式问题。 无法在表达式中使用嵌套聚合

[英]SSRS Expression issue. Not able to use nested aggregate in an expression

I'm trying to write an expression in SSRS where i am trying to use field from another dataset in SUM function but I keep getting the error message below:我正在尝试在 SSRS 中编写一个表达式,我正在尝试使用 SUM function 中另一个数据集的字段,但我不断收到以下错误消息:

The Value expression for the textrun 'Textbox41.Paragraphs[0].TextRuns[0]' uses a First, Last or Previous aggregate in an outer aggregate. textrun 'Textbox41.Paragraphs[0].TextRuns[0]' 的值表达式在外部聚合中使用 First、Last 或 Previous 聚合。 These aggregate functions cannot be specified as nested aggregates.这些聚合函数不能指定为嵌套聚合。

This is how my expression looks:这是我的表情:

=TimeSpan.FromTicks(Sum(TimeZoneInfo.ConvertTimeFromUtc(Fields!Diffrence.Value,TimeZoneInfo.FindSystemTimeZoneById(First(Fields!TimeZoneIDForCS.Value, "DS_Master")))))

Without knowing what your dataset looks like or the scope of the expression (where it sits in your report) it's hard to give a definitive answer but try these suggestions.在不知道您的数据集是什么样子或表达式的 scope(它在您的报告中的位置)的情况下,很难给出明确的答案,但请尝试这些建议。

If the value of TimeZoneIDForCS is the same, use MAX() instead of FIRST().如果 TimeZoneIDForCS 的值相同,则使用 MAX() 而不是 FIRST()。

Move the scope reference from the FIRST() function to the SUM() function.将 scope 引用从 FIRST() function 移动到 SUM() function。

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

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