Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services ssrs 2012开关表达式导致错误_Reporting Services_Ssrs 2012 - Fatal编程技术网

Reporting services ssrs 2012开关表达式导致错误

Reporting services ssrs 2012开关表达式导致错误,reporting-services,ssrs-2012,Reporting Services,Ssrs 2012,=开关(Fields!sale.Value=“1”,Fields!REC_ISU.Value,“0”,Fields!sale.Value=“2”,Fields!REC_ISU.Value,“0”,Fields!sale.Value=“3”,Fields!REC_ISU.Value,“0”)此代码抛出错误。有人能帮忙吗。提前感谢该表达式存在问题,但如果不知道您希望它做什么,则很难给出完整的答案 开关表达式的工作原理如下。。。 例如,如果我们想查看一个品牌名称并返回它是软饮料还是酒精,我们可以做如下

=开关(Fields!sale.Value=“1”,Fields!REC_ISU.Value,“0”,Fields!sale.Value=“2”,Fields!REC_ISU.Value,“0”,Fields!sale.Value=“3”,Fields!REC_ISU.Value,“0”)此代码抛出错误。有人能帮忙吗。提前感谢

该表达式存在问题,但如果不知道您希望它做什么,则很难给出完整的答案

开关表达式的工作原理如下。。。 例如,如果我们想查看一个品牌名称并返回它是软饮料还是酒精,我们可以做如下操作

=SWITCH(
        Fields!Brand.Value = "Coca-Cola", "Soft",
        Fields!Brand.Value = "Fosters", "Alcohol",            
        Fields!Brand.Value = "Smirnoff", "Alcohol",
        True, "Something else"
        )
这基本上是说“如果品牌是可口可乐返回“软”,如果是福斯特或斯米尔诺夫返回“酒精”,否则返回“其他东西”。当它发现一个条件为真时,开关停止评估,因此最后的真像一个其他,这意味着其他测试都不正确

我们可以通过替换

        Fields!Brand.Value = "Fosters", "Alcohol",            
        Fields!Brand.Value = "Smirnoff", "Alcohol",

正如您所见,您可以轻松地组合比较

有关更多信息,请查看此处

    Fields!Brand.Value = "Fosters" OR Fields!Brand.Value = "Smirnoff", "Alcohol",