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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Totals and Percentages

Status
Not open for further replies.

morechocolate

Technical User
Apr 5, 2001
225
US
I am using Crystal 8 to created 3 running totals for an amount field. I am using running totals rather than subtotals because of the data. There is a one to many relationship, therefore, in order to not get unwanted duplicate values in the total, I must use running totals.

The 3 running totals are 1)Subtotal on loan level, result is located in Group Footer 2 2)Subtotal on tier level, result is located in Group Footer 1 and 3)Grand Total, result is located in Report Footer 2.

If I use the following formula to get the percent of the grand total

WhilePrintingRecords;
#Loan Total % #Grand Total

The result is not correct. I suspect that this cannot be done. Is there an alternative?

Thanks

mc
 
First, you can probably eliminate rows from your totaling by using the previous() function in a standard formula, and then summing the formula.

For instance it might say:

If {table.groupid} <> previous({table.groupid}) then
{table.value}
else
0

Place this formula in the details, right click and insert summary->sum.

You should be able to reference it in a percent function too.

To get the best results here, try posting example data and expected output, along with versioning information for CR and the database.

-k
 
k-

Thanks for the response, however, if I am not mistaken because of when the previous function is evaluated your suggestion would not work.

For details, I am saying

Loan Policy Amount InsrType
100 1 100 All
100 1 100 Whole
100 2 200 All
100 2 200 Term

101 3 150 Whole
101 3 150 Term

I need to show the total for the loan 100 to be 300 and for loan 101 to be 150. The grand total should be 450. I was able to do the above using Crystal generated Running Totals.

However, using that I do not get the correct values for percentages if I use the running total info

#LoanLevel % #GT

What I would like to see is:

Loan Policy Amount Percent of Total
100 1 100 22.22
100 2 200 44.44
Loan Tot 300

101 3 150 33.33
Loan Tot 150
GT 450

I would conditionally suppress the other information using the next function.

Thanks

mc
 
Does anyone have a sample formula that will suppress a report's header based on the existence of a subreport?

My subreport has its own header, when it prints I want to suppress the main report's header. Is this possible?

Thanks in advance!!
 
FJR's qestions really belongs in its own thread. I'll try to answer it, though.

A subreport is not evaluated until all printing decisions have been made for the section, and for higher sections like report headers.

Normally people want to suppress the section if the subreport returns nothing. This can only be done by a 'work-round', running an invisible duplicate of the subreport in some higher section and getting a return. Such solutions are described at thread782-477236 same solution could be adapted to suppress a report header, but the first invisible subreport would have to be placed above the report header section. Maybe by splitting the report header, one part with the invisible subreport and the other with the printed details. But remember that subreports return nothing if suppressed.

Madawc Williams
East Anglia
Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top