Solved

Calculate total and percentage columns from ssrs 2008 r2 dataset for reports.

Posted on 2011-09-05
7
2,988 Views
Last Modified: 2012-06-21
Hi,

I have a situation to calculate the total of a column in dataset in ssrs 2008 r2 to calculate percentage in another column.

e.g.,

ValueColumn       TotalColumn        PercentageColumn
20                            69                      20/69*100
33                            69                      33/69*100
46                            69                      46/69*100


I want to create TotalColumn and Percentage from SSRS 2008 R2 dataset (using calculated field or some other method not sure!!!!!!!!!!!)

Your help and  suggesionss are highly appreciated.

Thanks.

0
Comment
Question by:ezkhan
7 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 36485741
what does the raw sql query look like? What is the table structure? Is TotalColumn a calculated field, or is it something directly from the DB?

You might be able to do this:

SELECT ValueColumn, TotalColumn, ValueColumn/TotalColumn*100 AS PercentageColumn FROM DataTable
0
 

Author Comment

by:ezkhan
ID: 36485815


I can do it in db but these columns are not individual columns e.g.,

As per your select statment ValueColumn is derived from number of aggregagetes and divisions with 10 different columns in database dataset. If I calculate percentage again in database then i need to calculate ValueColumn twice and there more than one columns where i need to calculate percentage. It slows down the whole query and increases CPU usage.

Thats why I want to calculate percentage from already calculated columns in Reporting Services instead of DB.

Please suggest solution in reporting services. Your answers and suggestions are greatly appreciated.

Thanks
0
 
LVL 22

Expert Comment

by:Thomasian
ID: 36486349
TotalColumn:
=Sum(Fields!ValueColumn.Value, "DataSetName")

Open in new window

PercentageColumn:
=Fields!ValueColumn.Value/Sum(Fields!ValueColumn.Value, "DataSetName")*100

Open in new window

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 9

Expert Comment

by:mimran18
ID: 36486574
try this

 
=Sum(Fields!FieldName.Value,"DatasetName")

Open in new window

=Round((Fields!SrNo.Value/SUM(Fields!FieldName.Value,"Dataset")*100),2)

Open in new window

0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 36486780
0
 

Author Comment

by:ezkhan
ID: 36491180



Thanks a lot for your suggesions; I want to use this calculated percentage column in pie chart as series!!!!!!!!!

Is this possible???????????
0
 
LVL 22

Accepted Solution

by:
Thomasian earned 500 total points
ID: 36493062
If you want to use it on a pie chart, you don't need to calculate the percentage manually. Just drop the ValueColumn on the data field and it will automatically divide the chart as percentage. If you want to show the percentage as label, then you could select #PERCENT as the Label Data.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now