Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Conditional Running Total

Posted on 2013-05-13
2
Medium Priority
?
302 Views
Last Modified: 2013-05-14
I have a crystal report where I am trying to do the following:

date              code             points calculated points      accum
04/26/13      TALP        0.5      0.5      0.5
04/29/13      TATD      1      1      1.5
04/30/13      TANN      0      5.5      7
05/01/13      TATD      1      1      8
05/02/13      TANN      0      1      9
05/03/13      TAUF      1      1      10
05/04/13      TALP             0.5      0.5      10.5

If the code is TANN, and the accumulated points are < 7, then the points to use for that TANN code are (7-accum), otherwise the points to use for the TANN code is 1.

It seems like I cannot have a running sum formula refer to itself.

Is there anyway to do this.  See attached example in an Excel file.
calcTANN.xls
0
Comment
Question by:ndornack
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 39163592
Sure with a manual running total

In the report header add a formula to declare the variables

WhilePrintingRecords;
Global NumberVar TotalPoints;
""

In the detail section add a formula where you want CalcPoints displayed
WhilePrintingRecords;
Global NumberVar TotalPoints;
Local NumberVar CalcPoints;

If {CodeField} = "TANN"  AND TotalPoints< 7 then
     CalcPoints := 7 - TotalPoints
Else If {CodeField} = "TANN" then
     CalcPoints := 1
Else
     CalcPoints := {PointsField};
TotalPoints:= TotalPoints+ CalcPoints;
CalcPoints

To display the new total points
EvaluateAfter({@CalcPoints});
WhilePrintingRecords;
Global NumberVar TotalPoints;
TotalPoints

mlmcc
0
 

Author Closing Comment

by:ndornack
ID: 39166047
Works great!  Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

824 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