Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Group totals and percentages from group totals Post Reply Post New Topic
Author Message
jsmarlow7102
Newbie
Newbie


Joined: 18 Mar 2013
Online Status: Offline
Posts: 4
Quote jsmarlow7102 Replybullet Topic: Group totals and percentages from group totals
    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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
jsmarlow7102
Newbie
Newbie


Joined: 18 Mar 2013
Online Status: Offline
Posts: 4
Quote jsmarlow7102 Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.