Print Page | Close Window

Running Total Problem

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1413
Printed Date: 07 May 2024 at 11:46am


Topic: Running Total Problem
Posted By: yggdrasil
Subject: Running Total Problem
Date Posted: 01 Oct 2007 at 7:38am
The detail line of my report shows data for a student with several events over a period. This is grouped by student.
 
In the footer, I am asked to total the number of types of student in  8 different tables (eg males/females, ethnicity etc) some of which are per type of school.
 
This is ok until some student is in two schools of different types during the period.  Now the running totals count him twice, and the totals in any table don't match the rest of the report where the type of school isn't involved.
 
 What they want is to only count him in the school type at the latest dated event in the period. Is there any way to do this using running totals?
 
Some of this data needs subreports to extract, I am already 'manually' summing the data from these because I cannot use sub-subreports or running totals here, so I do not want to have to create another couple of dozen formulae unless really necessary. There are nearly 200 already!



Replies:
Posted By: BrianBischof
Date Posted: 01 Oct 2007 at 9:57am
What I would do is create a global array and add the student to the array (I've done this before for similar problems). Then use the IN operator to see if the id is already in the array. If not, count him and add him to the array. If so, skip him. Works pretty well and it's a simple formula.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: yggdrasil
Date Posted: 02 Oct 2007 at 1:13am
I see what you are getting at, but I can't see how to do it. None of my reference books or on-line help describe how to create an array other than with a list of given values. I'm using Crystal 10, does that make a difference?  And if I did have an array of all student ids, how would I decide that the student was included in the count for the latest school type. I can't sort them until they are in the grouping.


Posted By: dada.dhumal
Date Posted: 04 Oct 2007 at 1:44am
create formula filed ( give condition)
summerize formula filed in running total field.
hope this works.



Print Page | Close Window