Solved

How to sort crystal report by calculated group percentage

Posted on 2008-10-15
4
699 Views
Last Modified: 2008-10-20
Hello,
I am new to Crystal Reports 11 and would like to sort a report by a calculated value within each group.  Specifically, I have a report of Tests (detail) grouped by Student.  Each test has an nPassed field (0 = failed, 1 = passed).  I would like to calculate the percentage of tests passed for each student, then sort the report by that value (while retaining the grouping by Student).   The result would look like:

  Test    Passed
  -----    ----------
Student:  Smith, John    90% passed
  Test1   1
  Test2   1
  Test3   0
  .... etc.
Student:  Bishop, Billy   85% passed
  Test1   1
  Test2   0
  Test3   0
  ... etc.

Each student might have a different number of tests.  I hope to add some drilldown and charting later, once I've got the sort correct so that the top students are at the top of the report.
TIA,
Larry
0
Comment
Question by:LarryT2
[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
4 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 125 total points
ID: 22726061
You can get the % with a formula like

Sum({nPassed},{StudentID}) / Count({nPassed},{StudentID})

You may be able to sort on it.

mlmcc
0
 

Author Comment

by:LarryT2
ID: 22734739
Thanks for the reply mlmcc.  I am able to create the formula you describe, which is interesting because of the use of a grouping parameter in the sum() and count() functions.  Unfortunately, I do not believe the results can then be applied to the group order;  at lease the resulting nPercentPassed formula field is not available under the Group expert Options / Common / Sort options.  I think this is because only simpler "first pass" fields and variables can be used at that point and that the group parameters in the nPercentPassed formula functions presuppose that grouping and group ordering has already happened.  I may have to do the sorting in my database before sending the data to Crystal, but still appreciate the information about the formula.  
-- Larry

BTW, this is my first question on EE and the whole "point" thing is new to me.  Since I apparently have unlimited points because of my subscription, is there any reason to not always set the point value to 500?  I'm happy to reward the help.  Or would this cause a sort of inflation that would undermine the meaning of the a point.  I picked 125 for this first question because the FAQ scale suggested this was the proper value for a basic question of moderate urgency.  Do people really post a range of values? or is everyone offering 500?  Does it matter?  Any thoughts on how this works would be appreciated.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22736425
Points are explained in the HELP
http://www.experts-exchange.com/help.jsp#hs8

There is no reason to not offer 500 points.

Originally you only had limited question points and earned them in a variety of ways.  Thus the idea of assigning points to a quesiton and trying to get the most for your $.  You could buy points in I think 1000 or 2000 point increments.

A few years ago EE added the monthly fee and in a marketing effort they give you unlimited points as a reward.  If you look around you will see most (probably 80-90%) are for 500 points.

Some experts ignore all questions not worth 500 points.  Others look for them knowing they will have fewer experts trying to get the answer.

To me it doesn't matter.  I don't even look at the points.  

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 22736432
I suspected you wouldn't be able to use the formula though I was hoping.

mlmcc
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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