Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Summarizing GH3 calculated field at GF1 level Post Reply Post New Topic
Author Message
wbbroyles
Newbie
Newbie
Avatar

Joined: 17 Dec 2009
Location: United States
Online Status: Offline
Posts: 8
Quote wbbroyles Replybullet Topic: Summarizing GH3 calculated field at GF1 level
    Posted: 17 Dec 2009 at 1:53pm
I have a report summarizing time and calculating overtime/regular time percentages and totals according to a 40-hour baseload.
 
                                               Allocation by
    Who What      HowLong       %OfWorked      40hr-Baseload
                                               (%OfWorked*40)
GH3 Joe Project1  10hours          20.00%           8 hours
GH3 Joe Project2  30hours          60.00%          24 hours
GH3 Joe Project3  10hours          20.00%           8 hours
GH3 Joe Vacation   8hours             n/a           8 hours
 
GF1 Joe Total:    58hours  TimeOff: 8hours  Worked: 50hours  TotalAllocation: xxx
 
The %OfWorked calculated field is dependent on the Worked field in the GF1 -- that is, I can't calculate each GH3's %OfWorked until I know the total Worked hours for Joe.  And the Allocation field is dependent on the %OfWorked field, so it is also dependent on the GF1 Worked total.  But I also need to sum the Allocation column and put it in GF1 in the xxx space.  I can't add a Summary on the Allocation field because it's calculated on the GF1 Worked calculated field.
 
How can I sum a calculated field from a lower-group level to a higher-group level when the calcuation is dependent on a field calculated at the higher-level group?

Thanks,
wbbroyles
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Dec 2009 at 6:15am
you can get the g1 summary inside of the g3.  SUM({table.field}, g1)
for summing the Allocaton field, I would use variables and create my own sum.
gh1:
shared numbervar aVar :=0;
""//hides the 0
gh3:
shared numbevar aVar;
aVar := aVar + //allocation amount...I would probably put this in the formula that calculates the allocation amount
gf1:
shared numbervar aVar
 
HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.