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

Summary for Part of a Secondary Group - Placed in Report Footer

Status
Not open for further replies.

skystar70

Technical User
Nov 3, 2006
40
US
Hi. Not sure how to explain this, but here goes. I have a report that has 2 groups:

Group 1 - Result 1
Group 2 - Result 1
Record 1
Record 2
Record 3
Group 2 - Result 1 Summary
Group 2 - Result 2
Record 1
Record 2
Group 2 - Result 2 Summary
Group 1 - Result 1 Summary

Group 1 - Result 2
Group 2 - Result 1
Record 1
Group 2 - Result 1 Summary
Group 1 - Result 2 Summary
Grand Total (in footer)

So, now what I need to do is get a summary for all records in Group 2 - Result 1 only, regardless of which Group 1 they fall in and get it to show in the report footer. I can get this if I switch the order of my groups.

To complicate matters further, my existing group summaries are formulas that combine other summary formulas and running totals. I couldn't do normal summaries because my data returns multiple records that duplicate the data I am trying to sum.

Sorry for the long email. Can anybody push my in the right direction?

Thanks,
Skystar

 
Are you looking for one summary figure or do you need each instance displayed in the report footer?

-LB
 
Assuming you are looking for a sum, create two formulas:

//{@accum} to be placed in the Group #2 footer:
whileprintingrecords;
numbervar sumgrp2res1 := sumgrpt2res1 +
(
if {table.group2} = "Result1" then
{@yourgrp2summary}
);

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar sumgrp2res1;

-LB
 
Lbass, forgive me but I am inexperienced with variables. When I try to create the first formula:

//{@accum} to be placed in the Group #2 footer:
whileprintingrecords;
numbervar sumgrp2res1 := sumgrpt2res1 +
(
if {table.group2} = "Result1" then
{@Sub Total In Budget Expense}
);

I get a message "A number, currency amount, boolean, date, time, date-time, or string is expected here. Should I be replacing 'sumgrpt2res1' with something? All I replaced in this formula so far is my group 2 summary.

Thanks for your help.
 
Lbass, never mind. This worked! I figured out that there were more fields I needed to replace with my own and also there was a slight type in the first formula.

Here is what I ended up with for the first formula:

//{@accum} to be placed in the Group #2 footer:
whileprintingrecords;
numbervar sumgrp2res1 := sumgrp2res1 +
(
if {@Group Budgeted/Unbudgeted} = "Proposed In Budget" then
{@Sub Total In Budget Expense}
);


Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top