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

Show totals minus 1 group

Status
Not open for further replies.

mrmookster

Programmer
Feb 8, 2005
27
GB
I have a report where I want to show both the report total and the report total less one of the subtotals in the group

ie
G1H
- G2H
- G2F
<G2 sub total 1>
<G2 sub total 2>
<G2 sub total 3>
<G2 sub total 4>
G1F
<G1 subtotal>
<G1 subtotal - G2 sub total 4>

How can I do this?

Thanks
 
Such a bizarre request, and we don't know what this subtotal is, post howitwas created and where, or at least what type of aggregate... I suspect you'll come back with an elaboration that renders efforts pointless at this stage, but try:

GF2 formula:

whileprintingrecords;
numbervar MyLastGF4Value:=sum({table.value},{table.Group2Field})

Then in the Gf1 use:
whileprintingrecords;
numbervar MyLastGF4Value;
"Total = " & sum({table.value}) & " less the last value in GF2 = " & MyLastGF4Value

-k
 
maybe it would be clearer if i illustrated with data

G2 (grouped on rank)
G3 by employee
detail suppressed

so the report shows
hrs
Assistant
mr X 2 (subtotal sum hrs)
mr Y 2 (subtotal sum hrs)

Trainee
mrXX 1 (subtotal sum hrs)
mrYY 3 (subtotal sum hrs)

PSL
mr XXX 1 (subtotal sum hrs)
mr YYY 1 (subtotal sum hrs)


Total 10 (sum of hrs)
Total - PSL 8 (sum of hrs - subtoatal PSL)

its the very last part i'm not sure how to do (Total - PSL)

 
Do a formula field, a simple subtraction

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Create a Running Total which breaks at the Rank group level, and has the evaluate use a formula of:

{table.rank}="PSL"

Now this formula in the group footer should work:

sum({table.hours}, {table.rank}) - {#MyRunningTotalField}

-k
 
Or you could create a formula:

if {table.rank}<> "PSL" then {table.hours}

Then insert a sum on this formula. This would work as long ase the subtotals for group #2 were simple inserted summaries.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top