[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Crystal - Count values from group footer

Posted on 2011-03-23
2
Medium Priority
?
619 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
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 …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

650 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