Solved

Crystal - Count values from group footer

Posted on 2011-03-23
2
614 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…

733 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