?
Solved

Crystal Report Running Totals

Posted on 2009-05-15
4
Medium Priority
?
848 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
[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
  • 2
4 Comments
 
LVL 101

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 101

Accepted Solution

by:
mlmcc earned 2000 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

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

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 …
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

770 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