Solved

How to sort crystal report by calculated group percentage

Posted on 2008-10-15
4
668 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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