简体   繁体   English

Expression中的SSRS Switch语句不起作用(对图表中的多边形进行颜色编码)

[英]SSRS Switch statement in Expression is not working (color code a polygon in a chart)

I have a report that breaks down financials by state. 我有一份报告,按州细分财务状况。 Here is what it looks like: 看起来像这样:

在此处输入图片说明

That is the tablix version of the data. 那是数据的tablix版本。 I also have a chart as a map where I want to display the data visually. 我也有一个图表作为地图,我想在其中可视地显示数据。

The actual data is broken up like this: 实际数据按如下方式分解:

NM City   100
NJ City1  100
NJ City2  100
NJ City3  100
NY City   100
NY City2  100

In SSRS, each state is a polygon. 在SSRS中,每个状态都是一个多边形。 在此处输入图片说明 I want to set the fill color of that polygon to be a color based on the Total Value of that state. 我想将该多边形的填充颜色设置为基于该状态总值的颜色。

The best way to do this would be to just set the color value equal to my formula against the total value. 最好的方法是将颜色值设置为等于我的公式对总值。 Then I would use that same line of code for every polygon and it would color code accordingly. 然后,我将对每个多边形使用同一行代码,并相应地对代码进行颜色设置。

However, I do not think the polygons know which state they belong to. 但是,我认为多边形不知道它们属于哪个状态。 For example, is there any way to get the New York Polygon to only look at the NY state value? 例如,有什么方法可以让“纽约多边形”仅查看纽约州的价值?

In case there isn't, I'm trying to so a switch statement where for every polygon I'll have it only get the value where the state name equals whatever I manually input. 如果没有,我尝试使用switch语句,在该语句中,对于每个多边形,我只能获得状态名称等于我手动输入的值的值。

=SWITCH 
(Max(Fields!State.Value, "CustomersByState") = "NE" , "10000"
 Max(Fields!State.Value, "CustomersByState") = "NY" , "20000"
 1=1,"Coral")

When I have that line be as the expression for the label name of that polygon (for testing, if I can make this work I can make anything work) it gives me an error and says comma, ')', or a valid expression continuation expected. 当我将该行作为该多边形的标签名称的表达式时(为了进行测试,如果可以进行此工作,我就可以使一切工作正常),它给我一个错误并说逗号“)”或有效的表达式继续预期。

我相信您在“ 10000”和“ 20000”之后需要一个逗号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM