Solved

SSRS - Ratio not calculating correctly

Posted on 2010-08-12
2
1,460 Views
Last Modified: 2012-06-21
I have a drilldown report and Group results for ELA/MHG are not calculating RATIO separately....  Any idea what I am doing wrong?

Ratio=Sum(Fields!ccSTA_MED.Value, "ReportDB")/(Sum(Fields!ccSTA_MED.Value, "ReportDB")+Sum(Fields!ccSTA_TELE.Value, "ReportDB")+Sum(Fields!ccSTA_ICU.Value, "ReportDB"))

Attached is an Excel Sample of SSRS report.

 Report2.xls
0
Comment
Question by:epicazo
[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
2 Comments
 
LVL 21

Expert Comment

by:Alfred1
ID: 33426542
It is possible that you might be missing a group if you have nested groupings (parent/child groupings) since you mentioned that you have a drilldown report.  
For example if you have four groups nested in hierarchical fashion (e.g.  Group1 -> Group2 -> Group3 -> Group4) and by chance your columns only accommodate three groups (e.g. Group1 -> Group2 -> Group4) for example, then the values would be different and your result would not calculate correctly.


Also, based on your Excel Spreadsheet, you need to provide a condition in your expression (e.g. using IIF) to determine if the values in the row are ELA or MHG in order to calculate the correct ratio for each row.  It looks like your aggregate functions is aggregating for both ELA and MHG.
0
 

Accepted Solution

by:
epicazo earned 0 total points
ID: 33433440
I really wouldn't want to put an iff condition, then otherwise it wouldn't be dynamically calculating groups.  I figured out the problem.   There I was using the "ReportDB"

Sum(Fields!ccSTA_MED.Value, "ReportDB")/(Sum(Fields!ccSTA_MED.Value, "ReportDB")+Sum(Fields!ccSTA_TELE.Value, "ReportDB")+Sum(Fields!ccSTA_ICU.Value, "ReportDB"))

This solved the problem...
Sum(Fields!ccSTA_MED.Value)/(Sum(Fields!ccSTA_MED.Value)+Sum(Fields!ccSTA_TELE.Value)+Sum(Fields!ccSTA_ICU.Value))

0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

732 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