Visual Studio函数IIF

q43xntqr  于 2023-10-23  发布在  其他
关注(0)|答案(1)|浏览(107)

我使用Visual Studio 2017,我有这样一个表达式:

=Microsoft.VisualBasic.Strings.Trim(Fields!QUESTION.Value) & 
   " Average:" &
    ROUND(AVG(fields!Multiple_Choice_Value.value), 2) &
    "(Range"  &
    Min(Fields!Multiple_Choice_Value.Value) &
    "- " &
    Max(Fields!Multiple_Choice_Value.Value) &
    ")"

输出为“Procedures Average:85(Range 85-100)
我需要修改这个代码:如果Multiple_Choice_Value为空,则输出将仅为Not Observed

pqwbnv8z

pqwbnv8z1#

也许是这样:

=IIF(Fields!Multiple_Choice_Value.Value Is Nothing, "Not Observed", 
    Microsoft.VisualBasic.Strings.Trim(Fields!QUESTION.Value) & 
       " Average:" &
        ROUND(AVG(fields!Multiple_Choice_Value.value), 2) &
        "(Range"  &
        Min(Fields!Multiple_Choice_Value.Value) &
        "- " &
        Max(Fields!Multiple_Choice_Value.Value) &
        ")"
    )

相关问题