Solved

Doing Percentages in Reporting Services SQL Server 2005

Posted on 2007-04-01
6
592 Views
Last Modified: 2008-01-09
I'm trying to show the following report in reporting services

The percentage field is percentage by contract/grade.

How do I have to do my grouping inorder to get that percentage field correct?

Contract A   SubContract B   Grade 1   10   10%
Contract A   SubContract C   Grade 2   40
Contract A   SubContract D   Grade 2   30   70%
Contract A   SubContract A   Grade 3   20   20%
Total Volume                                         100

Contract B   SubContract A  Grade 1   20   100%
0
Comment
Question by:Fraser_Admin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 42

Expert Comment

by:dqmq
ID: 18832379
Group by Contract in the underlying record source:

Select Contract, SubContract, Grade, yourtable.Quantity, yourtable.Quantity/ContractView.Quantity*100 AS Percentage
FROM yourtable
INNER JOIN
--this is the group by contract
(Select Contract, Sum(Quantity) Quantity from yourtable Group by Contract) AS ContractView  
ON  ContractView.Contract = yourtable.contract

0
 

Author Comment

by:Fraser_Admin
ID: 18832434
I don't understand the inner join?  Why would i do that part?
0
 

Author Comment

by:Fraser_Admin
ID: 18832614
Basically what I have right now is a grouping for contract and a grouping for grade.

So in my grade grouping, I need to access the total in the contract so I can do grade total / contract total to get my percentage.

But I can't seem to figure out the right thing to put in there??
0
 

Accepted Solution

by:
Fraser_Admin earned 0 total points
ID: 18832638
nevermind.  i figured out how to do it.  for anyone else trying to do something similar:

=Sum(Fields!volumeamount.Value,"GradeGroup") / Sum(Fields!volumeamount.Value, "ContractGroup")

You have to put the name of your group in quotes in your sum function so it knows where you are trying to take the sum from.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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