[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Crystal Reports Running Total in a Formula

Posted on 2009-03-30
9
Medium Priority
?
556 Views
Last Modified: 2012-06-21
Looking to find out how to write a formula that will calculate the running total of a field and reset on change of a group
0
Comment
Question by:nemesis1210
[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
  • 5
  • 4
9 Comments
 
LVL 6

Expert Comment

by:RPCIT
ID: 24022392
You shouldn't actually have to use a formula unless you want to get fancy. (which sometimes happens)

You can use a RunningTotalField (should show up in your fields list, right click and hit new) .

The running total field allows you to change when you want to evaluate, and when you want to reset.
0
 
LVL 2

Author Comment

by:nemesis1210
ID: 24022613
unfortunatly I need to get fancy, I need to be able to run a calculation on two existing running totals and am unable to do so, so I am hoping to be able to create formulas for these as opposed to running total fields so I can perform my calculation.

Thanks anyhow
0
 
LVL 6

Expert Comment

by:RPCIT
ID: 24022757
You can manually create runnign totals, or "fancy" formulas by adding formula fields to the sections you want..

you could put the reset field in the group header, the increment field in the detail, and the display in the footer.

using something like this in the code:

//begin increase value;
WhilePrintingRecords;
numberVar SomeVal;
SomeVal := SomeVal + {tablName.FieldName}
//end
 
//begin reset value;
WhilePrintingRecords;
numberVar SomeVal;
SomeVal := 0;
//end
 
//begin display value;
numberVar SomeVal;
SomeVal
//end

Open in new window

0
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.

 
LVL 6

Expert Comment

by:RPCIT
ID: 24022768
missing semi-colon (;) on line 4
0
 
LVL 2

Author Comment

by:nemesis1210
ID: 24022952
almost there, values increase during the detail and reset at each group, however display is always zero in the footer
0
 
LVL 6

Accepted Solution

by:
RPCIT earned 2000 total points
ID: 24022958
try adding whileprintingrecords; at the top of the display formula
0
 
LVL 2

Author Comment

by:nemesis1210
ID: 24023085
Perfect thank you
0
 
LVL 2

Author Closing Comment

by:nemesis1210
ID: 31564497
Worked like a champ
0
 
LVL 6

Expert Comment

by:RPCIT
ID: 24023842
You welcome :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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 …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

656 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