我有一个类似
的IIF语句 IIF(Fields!Title.Value = "Option1", Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value) + 1),
IIF(Fields!Title.Value = "Option2", Fields!OptionValue_Current.Value / (DateDiff("m", Fields!st_Date.Value, Fields!EndDT.Value) + 1),
IIF(Fields!Title.Value = "Option3", Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value) + 1)
有没有办法减少它,所以我可以像
那样 IIF(Fields!Title.Valuie = "Option1" "Option2" "Option3", Fields!fbrt_OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!cce_TermEndDT.Value) + 1)
感谢您的帮助
答案 0 :(得分:1)
这个Switch怎么样?
Switch(
Fields!Title.Valuie = "Option1",
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1,
Fields!Title.Valuie = "Option2",
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!st_Date.Value, Fields!EndDT.Value)+1,
Fields!Title.Valuie = "Option3",
Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1
)
OR
= IIF(Fields!Title.Value = "Option2",
(Fields!OptionValue_Current.Value / (DateDiff("m", Fields!st_Date.Value, Fields!EndDT.Value)+1),
(Fields!OptionValue_Current.Value / (DateDiff("m", Fields!Effective_Date.Value, Fields!EndDT.Value)+1)
)
答案 1 :(得分:0)
=Fields!OptionValue_Current.Value /
(DateDiff("m",
IIF(Fields!Title.Value = "Option2",Fields!st_Date.Value, Fields!Effective_Date.Value),
Fields!EndDT.Value
)+1
)