Solved

How to sort crystal report by calculated group percentage

Posted on 2008-10-15
4
687 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 100

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 100

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 100

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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