Solved

Crystal - Count values from group footer

Posted on 2011-03-23
2
609 Views
Last Modified: 2012-05-11
I am a crystal newbie and am trying to figure out how to count a value displayed in the group footer.  I have looked around at other requests but can't find one that quite fits my problem.

I have one to many structure, but I only want the Code from the most recent record in TableMany. Then I need to count (or sum) the total number of econDisadvantaged students.

Table1.Student-ID --> TableMany.Student-ID
                                   TableMany.Eff-Date
                                   TableMany.Code

FormulaField: EconDisadvantaged
Formula: if Table3.Code <> "P" then 1 else 0

I do not have anything in the detail. Rather I sorted on Student-ID and Eff-Date and have a group
footer at Student-ID. The report prints the student information just fine, but I can't get my
sum to work properly in the report footer.  It is summing for each record out of TableMany
instead of just the last record as displayed in the Group footer.

Group Footer
Student-ID    Name      EconDisadvantaged (or not)

Report Footer
DistinctCount(Student-ID)          # Students that are EconDisadvantaged

Is there a better way? How would I select only the most recent record out of TableMany?
(Which I would rather do than putting this in the footer.)  Thanks in advance for helping the newbie.
0
Comment
Question by:Crystal-baby
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 35203265
Try this idea

Add a formula to the report header
WhilePrintingRecords;
Global NumberVar CountDisadvantaged := 0;
""

In the group footer add a formula
WhilePrintingRecords;
Global NumberVar CountDisadvantaged;
If {Table3.Code} <> "P" then
   CountDisadvantaged := CountDisadvantaged + 1;
""

In the report footer
WhilePrintingRecords;
Global NumberVar CountDisadvantaged;
CountDisadvantaged

mlmcc
0
 

Author Closing Comment

by:Crystal-baby
ID: 35204019
Thanks for giving exact examples.  All I had to do was cut and paste.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now