Solved

Crystal Report Running Totals

Posted on 2009-05-15
4
833 Views
Last Modified: 2012-05-07
Hello,
I encountered an issue displaying Group Totals. Unfortunately my data source has duplicates of the value that I need to continually display and sum on different group footers throughout the report. I have put in a running total formula to extract a Distinct Sum. However this does not allow for a distinct sum on some groupings. Is there a way to subtract a previously display running totl value on a group from the current while printing records?
ex.
Asset #    Fueling_Count    Asset_Type
8018              7                       Crane
8018              7                       Crane
8018              7                       Crane
8019              10                     Crane
8019              10                     Crane
4548              20                     Forklift
4548              20                     Forklift
4649              9                       Forklift
4649              9                       Forklift
 &&

I need the footer to display like below

Asset Type                  Fuelings
Crane                               17
Forklift                              12
 ................................................
    Totals                           29

Instead I get

Asset Type                  Fuellings
Crane                               17
Forklift                              29
 ................................................
    Totals                           29

Any help would be appreciated, I'm using Crystal 11 and am unable to modify the table that I am extracting the data from.
0
Comment
Question by:cs486
  • 2
  • 2
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 24397912
There is no way to do that.

However you can use a second running total
Use the current one for the group total
Add a new one which is the same except have it reset on AssetType change
Group by AssetType if you aren't
Display the total in the AssetType group footer
Reset the total on change of the group AssetType

mlmcc
0
 

Author Comment

by:cs486
ID: 24398576
I believe i have tried whae you have stated but could not get the reset to work properly. Below is the Running Total that i am running and i am grouped on {%t_object_type_category} (Asset Type from my example above).

If you could assit in the proper way to reset the second Running Total on the Group Change. I have removed the  {EQUIP_MAINT_COST\\.OBJECT_CODE}  for my second RT but that only displays the last total for the last object for the Asset Type grouping which could be 3-15 objects.

Running total 1
//Report Header
WhilePrintingRecords;
numbervar RunT:=0;
numbervar DupT:=0;
numbervar Total2:=0;

//Report Detail
WhilePrintingRecords;
numbervar RunT;
numbervar DupT;
numbervar Total2;

RunT:= RunT + {EQUIP_MAINT_COST\\.TOTAL_FUELING};
if NOT OnLastRecord AND next({EQUIP_MAINT_COST\\.COMPANY}) = {EQUIP_MAINT_COST\\.COMPANY}
and Next({%t_object_type_category}) = {%t_object_type_category}
and Next ({EQUIP_MAINT_COST\\.CONTRACT}) = {EQUIP_MAINT_COST\\.CONTRACT}
and next ({%t_object_model_year})={%t_object_model_year}
and next ({EQUIP_MAINT_COST\\.OBJECT_CODE}) = {EQUIP_MAINT_COST\\.OBJECT_CODE} then
DupT:= DupT + {EQUIP_MAINT_COST\\.TOTAL_FUELING};
Total2:= RunT - DupT

//Report Footer
WhilePrintingRecords;
numbervar Total2;
Total2

cs486
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24398848
That is a manual running total.  I thought you were using the running total fields.

In the group header where you want the value reset (Change to the correct variable)
WhilePrintingRecords;
numbervar RunT;
RunT := 0;
''

mlmcc
0
 

Author Comment

by:cs486
ID: 24399015
Sorry for the confusion on that, but works like a charm now

Thank you
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now