SWITCH (Report Builder 1.0)

对一系列表达式求值并返回与第一个返回 TRUE 的条件相关联的值。Switch 可以有一个或多个条件/值对。

语法

Switch(condition1, value1, …)

condition1

指示要测试的条件。

value1

指定当条件为 True 时要用来替换项的值或表达式。

示例

公式

结果

SWITCH(Customer Type = "I", "Individual", Customer Type = "S", "Shop")

如果 Customer Type 为“I”,则显示单词“Individual”。如果 Customer Type 为“S”,则显示单词“Shop”。