Groups | Blog | Home
all groups > sql server reporting services > march 2006 >

sql server reporting services : RS2005- Pie Chart Percentages and Filter



GopherGold
3/23/2006 11:56:41 AM
I have a pie chart with the following filter expression:
=Parameters!Year.Value

The point labels for the pie chart are determined from the following
expression:
=sum(Fields!Expr1.Value)/sum(Fields!Expr1.Value, "SalesDM")

My problem is that the above calulation for percentage is incorrect for the
filtered dataset; the percentage is of the whole dataset. How do I get the
stcheng NO[at]SPAM online.microsoft.com
3/24/2006 12:00:00 AM

Hi,

welcome to the MSDN newsgroup.

From your description, I understand you're using the SSRS 2005 to create
some reports, and when using the Pie chart together with some filters on
the data, you found the pie chart always display the value from unfiltered
data, correct?

Based on my local testing, this is likely a project or environment specific
issue. I've tested a Pie chart report with filters setting in both Chart
region and in Dataset and both of them work. Are you using the filters in
chart region or in dataset? Or have you tried other report or datasource to
see whether this is a datasource specific issue.

Please feel free to let me know if there's anything I missed.


Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may

learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
GopherGold
3/24/2006 11:45:41 AM
Thank you for responding, Steven.

My dataset, SalesDM, returns data for several categories over two years.
There are no filters on the dataset. The dataset is used for a table, and is
unfiltered- it returns results as expected. I then use the dataset for a pie
chart. I set up a chart filter for one year's worth of data from the
dataset.- it properly returns results. When I calculate the point labels for
the pie chart, I use the expression in my original post. That calculation
does not take into account the filter applied to the chart.

I'm guessing that I need to reformulate my expression, but I don't know what
the proper formulation should be.



[quoted text, click to view]
stcheng NO[at]SPAM online.microsoft.com
3/27/2006 12:00:00 AM
Thanks for your response.

Yes, I agree with you that the problem is specific to the Point Label's
data expression. And I think the problem is likely due to the denominator
in your expression.

the "sum(Fields!Expr1.Value)" will return the current item's sum value on
Expr1 field. However, as for the "sum(Fields!Expr1.Value, "SalesDM")", I'm
not sure what is "SalesDM" exactly, but I guess it is the Dataset's
name(which is bound to your chart), correct? If so, this will cause the
data be retrieved directly from DataSet which is not filtered by the filter
you defined in chart. If this is the case, you can consider specific the
Chart's name in the sum expression. e.g:

sum(Fields!Expr1.Value, "PieChart1")

this will make the data be retrieved from the chart's dataregion which is
filled by the chart's filters. Or alternatively, you can also define
another dataset which use the same filters like your chart control and make
the sum expression specified that dataset as the scope value.

Hope this helps,

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
GopherGold
3/27/2006 5:09:02 AM
Thank you, Steven! Referencing the chart's dataregion is exactly the answer
I was looking for.


[quoted text, click to view]
stcheng NO[at]SPAM online.microsoft.com
3/28/2006 2:14:46 AM
You're welcome!

Also glad that we've got the problem resolved.

Have a good day!

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button