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!

Using Percentages with Running Totals

Status
Not open for further replies.

LFB

Programmer
Jul 2, 2001
38
AU
I am using running totals in my report and I would like to use them in some summary operations. Is there a work around to achieve the same result as when you select a summary operation on a database field, such as creating percentages of totals?

 
The only way to do a summar operation on a running total, is to create a formula running total that is built on variables. See the FAQ on running totals in the general forum, and use the 3-formula technique.

Also make sure that you need a running total in the first place. Often people use them when there are other totals that can accomplish the same thing. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanks Ken.
I took a look at that FAQ. I used the 3 formula technique before using the RT wizard.

Problem is that if I want to do a summary operation on a RT or a variable, I have to wait until the total is calculated before I can use it.

Eg Sales amounts are shown in the detail section,
Total Sales is calculated in the GF#1 section.

Since I need sales for the current period I have to use either an RT that is evaluated when {Period.EndDate}=Maximum({Period.EndDate}) or a variable that does the same thing.

I want to get a percentage result, say (Sales / Total Sales)*100, and I want to display this result next to each sales amount. It won't work because for each line in the detail section Total Sales is still being calculated.

When you use the Summary Operation feature for a database field you can tell it you want to base the percentage calcuation on a subtotal or grandtotal in a following section. I need to be able to do this with RT's or variables.

Thanks in advance
 
You can't summarize something that uses a summary, since there is only one pass for calculating true summaries (Just after WhileReadingRecords) and then the second pass for running totals. You have burnt one pass by using the MAXIMUM function in your condition.

But, if you can write a formula that determines your current period without using the MAXIMUM function, then you can use a conditional formula, and a regular total.

Is there another way to determine the current period, maybe from your parameter input? Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top