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!

Percentages Of Total With Running Totals 1

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
Hi ALL

CR10

I have a report where i am using runingtotals to get the overall grand Total for the report, and using running Totals within the groups to total counts and sums within the groups. The issue is trying to calculate the % of grand Total for the totals in the groups. The groups keep trying to calculate the percentage based on the running total amount for that group ie i want to do a simple calculation based on the sum for that group and the grandTotal.

any ideas
 
You need to create a Grand Total using Insert, Grand Total to replace your Running Total Grand Total.

If you are not doing any evaluations in your Running Totals, then you can just create your Subtotals and Grand Totals by using Insert, Grand Total or Insert, Subtotal and choosing the summary type, the field to summarize, and at what grouping.

If you are evaluating currently in your Running Totals, you will need to create a formula to return a value or a 0 for each record, then you can Insert the summary on it.
The formula should look something like this if you are trying to accumulate values in a field:
Code:
if {table.field} = True then
    {table.amount}
else
    0
OR like this is you want to count the field when it meets the condition:
Code:
if {table.field} = True then
    1
else
    0
Either way, when you create your summary, you will want to use the SUM summary type.

~Brian
 
I'm experiencing the same dilemma and maybe somebody has an alternative solution to using the sum function? CR 8.5, sybase, ODBC or sybase server connection.

I'm using manual running totals in my report because the field I need to evaluate is a sequence number, which begins at 1 each day for each employee. I need to use the distinct count or maximum function to get the number of sequences per day for each employee, and so then I can't use sum for further groups. The manual totals are all working perfectly, but just like ganjass, when I try to calculate Group 2's % of Group 1, it's using Group 2's running total as the denominator, as opposed to the Group 1 total.

Sample of results that I'm getting:
Group 3 (date)
Group 2 (employee)
Name #seq %ofBranch
Amy 100 100%
Becky 150 60%
Cathy 250 50%
Group 1 (branch location)
Total 500

Results should be Amy 20%, Becky 30%, Cathy 50%.

Thanks in advance,
P.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top