SSRS:如何聚合列的某些值?

时间:2016-08-18 21:14:18

标签: reporting-services aggregate

我在SSRS中有一个专栏(Say PriceA),它根据Expression进行填充。

PriceA.value

IIF((Fields!MOP.Value = "PRIV" OR Fields!MOP.Value = "FACI" OR Fields!MOP.Value = "GUAR" OR Fields!MOP.Value = "CASH"
OR Fields!MOP.Value = "CHRG" OR Fields!MOP.Value = "INV"), 

    IIF(Fields!UDRx.Value,"U/D",Fields!TtlPrice.Value), 

        IIF(Fields!elecadj.Value="0" AND Fields!elecadj2.Value="0", IIF(Fields!UDRx.Value,"U/D",IIF(Fields!MOP2.Value="0",Fields!Copay.Value,"")), 

            IIF(Fields!UDRx.Value,"U/D",Fields!PatientPayAmt.Value)
        )
    )

PriceA中的值可以是“U / D”或零或某个值为“150.00”。现在我想在报告的最后显示该列中的行的汇总,丢弃值$ 0.0和“U / D”。

我该怎么做?

我还有另一个专栏,它显示基于2个不同表达式的值,我需要聚合。那个也没有用。

2ndPriceA_expression

IIF((Fields!MOP.Value = "PRIV" OR Fields!MOP.Value = "FACI" OR Fields!MOP.Value = "GUAR" OR Fields!MOP.Value = "CASH"
OR Fields!MOP.Value = "CHRG" OR Fields!MOP.Value = "INV"), " ",

    IIF(Fields!elecadj.Value="0" AND  Fields!elecadj2.Value="0",

        IIF(Fields!UDRx.Value="0",Format(Fields!TtlPrice.Value,"C"),"U/D") , 

            IIF(Fields!UDRx.Value="0",Format(Fields!Payor1PaidAmt.Value,"C"),"U/D")
    )

)

2ndPriceB_expression

IIF(Fields!MOP2.Value<>"",
    IIF(Fields!elecadj.Value="0" and Fields!elecadj2.Value="0"
        ,IIF(Fields!UDRx.Value="1","U/D",Fields!Copay.Value)
        ,IIF(Fields!UDRx.Value="1"
            ,"U/D"
            ,IIF(Fields!elecadj2.Value="0"
                ,Fields!Copay.Value
                ,Fields!Payor2PaidAmt.Value
                )
            )
        )
," ")

我需要显示2ndPriceA&amp;的汇总数据第三个单元格中的2ndPriceB。对不起,我已经有2周的新SSRS了。

提前致谢。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

只需执行一个IIF()表达式的SUM(),它将过滤掉您不想要求值的值。