Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total Question

Status
Not open for further replies.

bamitts

Technical User
Nov 18, 2001
12
US
I'm very new to Crystal Reports, so this might be a very, very easy question...at least I hope it is!

I would like to do a running total of costs and hours for certain phases. The phases are 6 digit numbers that are 4 digit and 2 digit (i.e. 1111.22) I would like to insert a subtotal only when the first 4 digits changes. At this time it wants to subtotal when the last 2 digits changes.

Like I said, I'm really new, but I've tried to insert the following formula in a running total:

if (left(cost,4))<>(Left(cost,4)) then 0

and I get a subtotal for every phase and it never resets!!

I just don't get it!! help please!
 
Running totals are much easier in versions of crystal reports of 7 and higher. Assuming you are working with that, Create 2 formula fields, one would be left({cost},4) and the other would be left({Cost),6).

Then create 4 running total fields, summarizing costs and hours by each of the 2 formula fields, reset as needed.

If you are working with version 6 or earlier, this becomes immensely more complicated. You have to declare, calculate and reset variables for each of the items you want subtotaled. This is potentially a ton of formulas.

Post back on th eboard if you have any questions. Software Support for Sage Mas90, Macola, Crystal Reports and Goldmine
 
You said that you want to:

&quot;insert a subtotal only when the first 4 digits changes&quot;

That doesn't sound like a running total, but a simpler subtotal by phase. If you want to see the total accumulate up to the total on each record, use a running total.

If you just want a subtotal for each phase you should:
Create the formula to create a PHASE:

Left({cost},4)

Insert a Group on this formula, and create the subtotals by selecting your numeric columns, one at a time, and using Insert-Subtotal. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thank you so much Kenhamady & DGillz for helping me.

Kenhamady was right, I didn't need a running total, but a subtotal and after following your directions, got it to work great!

Thanks again!
B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top