0

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

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48
PJD
  • 743
  • 2
  • 12
  • 38

1 Answers1

2

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.

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48
  • That has worked exactly as I wanted and a lot easier than what I was trying to do, you would of hoped though that there would of been an option to do this a the series data label level as if you had a lot of different series this could take some time. For now though this is brilliant, thanks for your help – PJD Sep 30 '16 at 14:10