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!

Sum Grouped Values 1

Status
Not open for further replies.

mmck1964

Technical User
Jul 12, 2001
104
US
I am trying to sum grouped values to no avail. I've searched the threads for the answer, but I am missing something. Please advise.

Group 2 Header:
whileprintingrecords;
numbervar G4Total;
if not inrepeatedgroupheader then
G4Total := 0;

Group 4 Footer:
numbervar G4Total;
numbervar G4Total := {@f_PresRd_kWhT}+{@f_G3Footer}

Group 2 Footer:
whileprintingrecords;
numbervar G4Total;
G4Total

I keep getting the value in the Group 4 Footer in the Group 2 Footer. I want to sum each value that is in the Group 4 footer in the Group 2 Footer.
Please advise what i am missing.

Thanks,
Mark


 
It seems to me you could try to actually create a formula that gives you the total you need - {@f_PresRd_kWhT}+{@f_G3Footer} - and then use the running total expert to sum it up, resetting on group 2 and evaluating on change in group 4...

-jcrawford-

Not in word only, but in deed also... 1Jn3:18
 
Except the formula field {@f_PresRd_kWhT}+{@f_G3Footer} is not an option to select in the Running Total Fields list. I even created a separate field that looks at the formula field {@f_PresRd_kWhT}+{@f_G3Footer} and it is not in the Running Total Fields list either.
 
Change grp 4 Footer formual to this

Group 4 Footer:
numbervar G4Total;
numbervar G4Total := G4Total+ {@f_PresRd_kWhT}+{@f_G3Footer};

Otherwise you will only get the last value of Group4

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top