Reporting services 在SSRS中使用具有相似条件的多重IIF

Reporting services 在SSRS中使用具有相似条件的多重IIF,reporting-services,expression,sql-like,iif,Reporting Services,Expression,Sql Like,Iif,我有一个使用多个IIF的表达式,但出于某种原因,每个记录在列中都列为“Immunized”,也许我在这个查询中做了一些错误的事情。我真的很感谢你帮我解决这个问题 =IIF(Fields!CompliantWith.Value like "*Declin*", "Valid Declination - " & IIF(Fields!DeclinationValue.Value <> nothing,Fields!DeclinationVa

我有一个使用多个IIF的表达式,但出于某种原因,每个记录在列中都列为“Immunized”,也许我在这个查询中做了一些错误的事情。我真的很感谢你帮我解决这个问题

=IIF(Fields!CompliantWith.Value like "*Declin*", "Valid Declination - " & IIF(Fields!DeclinationValue.Value <> nothing,Fields!DeclinationValue.Value, "Not Specified"),
IIF(Fields!CompliantWith.Value like "*Contraindication*", "Medical Contraindication - " & IIF(Fields!ContraindicationValue.Value <> nothing,Fields!ContraindicationValue.Value, "Not Specified"),
IIF(Fields!CompliantWith.Value like "*Exemp*", "Valid Exemption - " & IIF(Fields!ExemptionValue.Value <> nothing,Fields!ExemptionValue.Value, "Not Specified"),
IIF(Fields!CompliantWith.Value like "*Immunize*", "Immunized",""))))
=IIF(字段!与“*Declin*”、“Valid Declination-”等值的符合性)和IIF(字段!DeclinationValue.Value nothing,字段!DeclinationValue.Value,“未指定”),
IIF(字段!符合性,如“*禁忌症*”、“医疗禁忌症-”&IIF(字段!禁忌症值.Value nothing,字段!禁忌症值.Value,“未指定”),
IIF(字段!CompliantWith.Value,如“*Exemp*”、“有效豁免-”&IIF(字段!EXCEMPTIONVALUE.Value nothing,字段!EXCEMPTIONVALUE.Value,“未指定”),
IIF(字段!与“*Immunize*”、“Immunized”、“”)等值的符合性)

试着用
.Contains
替换像
这样的
并删除*

就我所知,在SSRS表达式中不直接支持Like

那么这个

Fields!CompliantWith.Value like "*Declin*"
会变成这样吗

Fields!CompliantWith.Value.Contains("Declin")

你可能还想考虑这样的情况下使用=开关,它比嵌套的IIF

更容易阅读。