Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Conditional Running Total

Posted on 2013-05-13
2
Medium Priority
?
299 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
[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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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. …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

719 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