Wednesday, March 7, 2012

Don't show point labels if value is zero

Hey, I have a stacked column chart. It shows headcount per month. The headcount is split up into employees and contractors.

I added point labels to the chart to display the exact headcount value per month. (=Sum(Fields!HeadCount.Value)) Now here is the problem: Some months don't have contractors so there is a 0 displayed at the bottom of the X-axis. I don't want this to happen!

I already tried to change the expression of the point labels to this:
=IIF(Sum(Fields!HeadCount.Value,"chart1_SeriesGroup1") > 0,Round(Sum(Fields!HeadCount.Value),1)," ")

But this keeps displaying the 0. Even if the last parameter in the previous expression is 'nothing' it is still displayed.

I hope it is possible to remove them ...

Some additional info:
series field is: Contractor: which is a boolean that determines if the employee is contractor or not
category field is: Month (a month representation like ... January 2006, February 2006 ...)
Data field is: headcount (the headcounts of the employees).

You can use the datavalue to compare with 0. You don't have to compare the total of the chart1_SeriesGroup1 to 0.

Is your case: =IIF(Sum(Fields!HeadCount.Value) > 0,Round(Sum(Fields!HeadCount.Value),1)," ")

No comments:

Post a Comment