Solved

Crystal - Count values from group footer

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

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. …
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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