By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

Problems in CALCULATING PERCENTAGE in SSRS 2005 Reports..

P: 14
I'm Using Asp.Net with C# & Working with SSRS 2005 for Generating Reports..

The Following Expression I'm using in Reports to Show the Percentage of Particular Items in REPORT..

=Round((Fields!Clicks.Value*100)/Sum(Fields!Clicks_Show.Value, "DataSet1_Get_All_1234567"),2)& "%"

With this Expression I'm Getting Reports Percentage(Total) 100%(NO Problem)..

But for Some Reports it is Coming >100 or < 100 Total Percentage (ie 105% or 95%, --)..

For Some Reports, I'm Getting SAME PERCENTAGE VALUES to All Items..
ie In One Report Assume I'm having 4 Items.. I'm Getting ONE Percentage Value to All Items in That REPORT.. Just Like 35%,35%,35%,35%).. But when we Calculate the Items Percentage Values SEPERATELY RESULT is Different (Just Like 35%, 15%, 30%, 20%)..

I want to Give TOTAL Percentage for ONLY 100% for Reports..

How to do this..

What is the Wrong in My Expression.. Why It is Giving Correct Percentage for Few Reports & Wrong Result to Remaining Reports.. & Also Why Same Percentage Values are Repeating for All Items in Few REPORT's...


Thank You..
Apr 9 '08 #1
Share this Question
Share on Google+
5 Replies


P: 92
=Round((Fields!Clicks.Value*100)/Sum(Fields!Clicks_Show.Value, "DataSet1_Get_All_1234567"),2)& "%"
Is Clicks the same with Clicks_Show? If not, what is Clicks_Show?
I think that is where the problem is... you need to get and use the same values.
Apr 9 '08 #2

P: 14
Is Clicks the same with Clicks_Show? If not, what is Clicks_Show?
I think that is where the problem is... you need to get and use the same values.
No Clicks & Clicks_Show are Different..
Clicks is One Column & Clicks_Show is Another Column..
Apr 9 '08 #3

P: 26
Round((Fields!Clicks.Value*100)/Sum(Fields!Clicks_Show.Value, "DataSet1_Get_All_1234567"),2)& "%"
One of the apparent issues that I see is the use of both aggregate and non-aggregate field in the same expression. I'm not sure how your report is grouped and designed (whether matrix or table) and hence won't be able to give you an exact solution. In all my reports whenever I've to do a percentage calculation I either use the aggregate values sum(fieldname) or add a calculated expression to the dataset itself and then drag & drop it on the report.

As for the percentage values more than 100%, that's purely mathematical and possible. For example, if your clicks value is 200 & the clicks_show value is 100, what should be the percentage value? maybe I'm getting it wrong but your post doesn't say it clearly enough.
Apr 9 '08 #4

P: 92
No Clicks & Clicks_Show are Different..
Clicks is One Column & Clicks_Show is Another Column..
Yeah, obviously they are different columns, but what I'm trying to ask is whether they have the same values or not... because it is illogical to get the percentage of an amount with respect to a sum of another set of amounts. You might get a total of 100% of all your calculated percentages but most probably you'll get > or < 100%.

Well, correct me if I'm wrong..

You could consider doing it like this way:
= (Clicks * 100) / Sum(Clicks)
OR
= (Clicks_Show * 100) / Sum(Clicks_Show)
Apr 10 '08 #5

P: 14
Yeah, obviously they are different columns, but what I'm trying to ask is whether they have the same values or not... because it is illogical to get the percentage of an amount with respect to a sum of another set of amounts. You might get a total of 100% of all your calculated percentages but most probably you'll get > or < 100%.

Well, correct me if I'm wrong..

You could consider doing it like this way:
= (Clicks * 100) / Sum(Clicks)
OR
= (Clicks_Show * 100) / Sum(Clicks_Show)


No they Don't Have Same Values.. They Are Different..
Just Check Here..

Clicks Values : 9000, 8000, 10000

Clicks_Show Values : 8000, 6500, 11000

The Percentages I'm getting : 35.29%, 31.37%, 39.22%

The Total of these Percentages are >100.. But I want to show Total Calculation for 100%..
Apr 10 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.