Solved

Crystal - Count values from group footer

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
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 …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 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

13 Experts available now in Live!

Get 1:1 Help Now