Print Page | Close Window

Group totals and percentages from group totals

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21660
Printed Date: 06 May 2024 at 11:02am


Topic: Group totals and percentages from group totals
Posted By: jsmarlow7102
Subject: Group totals and percentages from group totals
Date Posted: 25 Aug 2015 at 10:50am
Hello All:
  I have a similar question but not exactly what I have seen so far.   I have a report that I show each line as "pass" or "fail".  There will be many groups in this report so I will have a group and total summary.  
 
I am using counters and summarize them for the group footer (this works fine).   Now I also need to provide for each group the percent that passed and failed.   When I create a formula to calcuate the percent, it is using all of the records for the calculation not just for this group.   This is because the formulate workshop does not appear to know about a group break.
 
Ideas as to how to create percentages for a group based on the summarized group totals and for each group?   Thanks all.



Replies:
Posted By: hilfy
Date Posted: 27 Aug 2015 at 7:14am
The summary functions can be set to work for a group. So, I would do something like this:

if Count({key field}, {Group field}) > 0 then
Count({passed count}, {Group field} % Count({key field}, {Group field})
else 0

The If part of the statement is used to prevent division by zero.

-Dell

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: jsmarlow7102
Date Posted: 27 Aug 2015 at 9:48am
Hi Dell:
     Thanks for responding.  Yes, while suming in the formula I forgot to add the group option which caused it to sum for the entire report.   I seems to work now, thanks for the tip!
Scott



Print Page | Close Window