[英]SRSS Report Builder SUM IIF from different datasets
I have two datasets in Report Builder 3.0 with a similar field and I want to put a SUM of the number occurrences of a particular value in that common field across both datasets. 我在Report Builder 3.0中有两个具有相似字段的数据集,我想在两个数据集的公共字段中放置特定值出现次数的总和。
I've got an expression I'm using for each individual dataset: 我有一个表达式,我用于每个单独的数据集:
=SUM(IIF(Fields!caseorigin.Value = "mail",1,0))
and 和
=SUM(IIF(Fields!cliorigin.Value = "mail",1,0))
But I can't seem to work out a way to sum the values from both datasets. 但我似乎无法找到一种方法来对两个数据集中的值求和。 I've tried: 我试过了:
=SUM(IIF((Fields!caseorigin.Value, "caseDS") = "mail",1,0)) + SUM(IIF((Fields!cliorigin.Value, "cliDS") = "mail",1,0))
Is there any way to make this work, or an alternative method? 有没有办法让这项工作,或另一种方法?
Just looks like a syntax error here; 看起来像这里的语法错误; when specifying a scope it should like something like: 在指定范围时,它应该像:
=Sum(Expression, Scope)
Applying this to your example: 将此应用于您的示例:
=SUM(IIF(Fields!caseorigin.Value = "mail",1,0), "caseDS")
+ SUM(IIF(Fields!cliorigin.Value = "mail",1,0), "cliDS")
Should work for you. 应该适合你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.