SSRS表达式嵌套的iif表达式

时间:2018-07-12 08:24:55

标签: reporting-services expression iif

您好,我正在SSRS的一个项目中工作,所以做对了。也许你可以帮我吗?因此,我有一个带有三个不同Tablix的报告,其中中间一个计算了其他两个的比率。我的问题是我不知道如何计算比率行的Diff列。 enter image description here

我这样解决了比率行:

 =(Sum(iif(Fields!OutputType.Value = "123", 
    Fields!Production.Value, CDec(0))))/(Sum(iif(Fields!OutputType.Value = "456", Fields!Production.Value, CDec(0))))

我解决了123和456组的Diff列:

=(Sum(iif(Fields!MonthNo.Value = 2018, Fields!Production.Value, CDec(0))))-(Sum(iif(Fields!MonthNo.Value = Budget, Fields!Production.Value, CDec(0))))

我认为将这两个表达式结合起来可以解决我的问题,但是我不能真正做到这一点。我已经尝试过类似的方法,但是我只能得到零。

=(Sum(iif(Fields!MonthNo.Value = "2018",
       (Sum(iif(Fields!OutputType.Value = "123", Fields!Production.Value, CDec(0))))/(Sum(iif(Fields!OutputType.Value = "456", Fields!Production.Value, CDec(0)))), CDec(0)))) 
       -
(Sum(iif(Fields!MonthNo.Value = "Budget",
        (Sum(iif(Fields!OutputType.Value = "123", Fields!Production.Value, CDec(0))))/(Sum(iif(Fields!OutputType.Value = "456", Fields!Production.Value, CDec(0)))), CDec(0))))

0 个答案:

没有答案