我要在现有报告中添加一个名为“退款到期”的新列。在本专栏中,我正在为以下逻辑编写表达式:
如果incurred > 0
,则用No
如果incurred =< 0 and status = "closed"
,则在Yes
如果incurred =< 0 and status does not equal "closed"
,则在"Refer"
我写了以下表达式
=IIF (Fields!GROSS_CLAIMS_INCURRED.Value>"0", "No", IIF(Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Closed", "Yes", IIF(Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Open", "Refer", IIF(Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Reopen", "Refer"))
但是在预览报告时会收到以下错误消息:
textrun的Value表达式 ‘Textbox154.Paragraphs [0] .TextRuns [0]”包含错误:[BC30516] 重载解析失败,因为没有可访问的“ IIf”接受 参数数量。
如何解决此问题,或者必须使用哪种表达式才能获得所需的结果?
在此先感谢您的帮助。
答案 0 :(得分:0)
SWITCH
语句相比, IIF
是多个条件表达式的一种更简洁的方法:
=SWITCH(Fields!GROSS_CLAIMS_INCURRED.Value>"0", "No",
Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Closed", "Yes",
Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Open", "Refer",
Fields!GROSS_CLAIMS_INCURRED.Value<="0" AND Fields!STATUS.Value="Reopen", "Refer"
)