带有开关错误的嵌套 IIF 语句



我的一个 tablix 字段中有以下语句,在呈现报表时刚刚收到 #error。 我不确定确切的问题,但如果有人能指出我正确的方向,那将是有帮助的;

=IIF(Fields!inflowType.Value="1",
    Switch(
          Fields!inflowTaxTreatment.Value = "0","Amount is Pre-Tax",     
          Fields!inflowTaxTreatment.Value = "1","Amount is Post-Tax/Not Taxed") ,Nothing) 
Or 
IIF(Fields!inflowType.Value = "3",
    Switch(
         Fields!inflowTaxTreatment.Value = "0","Tax Deferred",
         Fields!inflowTaxTreatment.Value="1","Tax Free"),Nothing) 
Or 
IIF(Fields!inflowType.Value="0",
    Switch(
         Fields!inflowTaxTreatment.Value="0","0% Taxable",
         Fields!inflowTaxTreatment.Value="1","50% Taxable",
         Fields!inflowTaxTreatment.Value="2","85% Taxable"),Nothing)

基本上我不知道我是否可以使用嵌套的 switch 语句来实现同样的事情,我认为这是对另一个被接受的线程的建议,但它对我不起作用。

尝试

=IIF(Fields!inflowType.Value="1",
    Switch(
          Fields!inflowTaxTreatment.Value = "0","Amount is Pre-Tax",     
          Fields!inflowTaxTreatment.Value = "1","Amount is Post-Tax/Not Taxed") ,  
IIF(Fields!inflowType.Value = "3",
    Switch(
         Fields!inflowTaxTreatment.Value = "0","Tax Deferred",
         Fields!inflowTaxTreatment.Value="1","Tax Free")
,
IIF(Fields!inflowType.Value="0",
    Switch(
         Fields!inflowTaxTreatment.Value="0","0% Taxable",
         Fields!inflowTaxTreatment.Value="1","50% Taxable",
         Fields!inflowTaxTreatment.Value="2","85% Taxable"),Nothing)
))

我不确定,但我认为这是你想要得到的,让我知道这是否对你有帮助。

最新更新