我有一个要在其中基于Continent列值更改列(销售)背景颜色的报告。以下是大洲列值。
我在“销售”列(背景色)下尝试了以下表达式,
=IIF(Fields!column.Value ="4th Quarter",
SWITCH (
Fields!continents.Value ="Asia", "Green",
Fields!continents.Value = "N America","LIMEGREEN",
Fields!continents.Value ="S America","Yellow",
Fields!continents.Value = "Europe", "Red"
)
, "Dummy Value")
预览报告时,所有行只能看到绿色。我知道SSRS中的Switch函数将返回它找到的第一个表达式。
我也尝试只使用IIF条件,仍然是同样的问题。有没有办法可以实现?
答案 0 :(得分:0)
您是否尝试过以下方法?
=IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="Asia"),"Green",
IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "N America"),"LIMEGREEN",
IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value ="S America"),"Yellow",
IIF((Fields!column.Value ="4th Quarter") AND (Fields!continents.Value = "Europe"), "Red",
"Dummy Value"))))