0
votes

SQL Server 2012 - SSRS Questions

I currently have a Pie chart that shows the number of deliveries as a percentage on whether they are late, on time or early. What I am trying to do is use an Expression in the Chart Series Labels "Visible" property to hide the label if it is 0 on the chat. Of note in the table this value is returned as 0.00 I have tried using various SWITCH and IFF Statements to do this but nothing seems to work and its likely I am getting the syntax wrong, can anyone help?

Table Values

TotalIssued Early Late OnTime EarlyPerc LatePerc OnTimePerc
6, 0, 4, 2, 0.00, 66.67, 33.33,

 =SWITCH(
 (First(Fields!EarlyPerc.Value, "EstimatesIssued") = 0),false,
 (First(Fields!LatePerc.Value, "EstimatesIssued") = 0),false,
 (First(Fields!OnTimePerc.Value, "EstimatesIssued") = 0),false,
 true)

Thanks

1

1 Answers

2
votes

Try:

=SWITCH(
 First(Fields!EarlyPerc.Value, "EstimatesIssued") = 0,false,
 First(Fields!LatePerc.Value, "EstimatesIssued") = 0,false,
 First(Fields!OnTimePerc.Value, "EstimatesIssued") = 0,false,
 true,true)

UPDATE:

If you have one field per percentage and your dataset returns one row always, you have to select each serie in the ChartData window and press F4 to see properties window.

In properties window set for EarlyPerc Visible property:

=IIF(Fields!EarlyPerc.Value=0,False,True) 

And so on for the next two series you have (LatePerc and OnTimePerc).

enter image description here enter image description here

Let me know if this helps.