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!

Taking the average of two subtotals in different subreports

Status
Not open for further replies.

NKSturdy

Technical User
Jul 10, 2003
2
US
I have two large databases running in each subreport, and wish to not combine them. But I need to take the two subtotals from each report and get their average. Is there a formula to do so?
 
You should be able to create a shared variable in each subreport like:

shared numbervar database1amt := sum({table.amt},{yourgroup})

Repeat for other database. Then in the main report create a formula like:

sharednumbervar database1amt;
sharednumbervar database2amt;
numbervar ave1and2;

ave1and2 := average([database1amt,database2amt])

-LB

 
Hi,
I have a similar problem. I have a report that contains a subreport that displays some amount details. How to display the subtotal and grand total calculated in the subreport in the main report's footer?
Any ideas?
 
If the calculations are contained within the subreport and you do not need to incorporate any data from the main report into your calculations, then you should be able to just display the subreport results in the report footer by placing the subreport there. If this doesn't work, perhaps you could provide more detail.

-LB
 
Hi,
I need to place the subreport in the details section of the main report. The subreport's grand totals should be displayed in the main report's footer. If I place the totals in the subreport, the totals appear for all details section which should not happen. They should be displayed in the footer only.

Can I obtain the subreport's columns outside this report?
For eg, can I say sum(subreport.amount) and place it in the main report?
 
ssudha: Chekc out LB's example of using shared variables above.

That's how you get data across main and subreports.

You would then use a formula to sum the shared variable as it comes out of the sub (remember that the subreport has to fire BEFORE you can use a shared variable.

-k
 
Ya, I tried with that example but the shared variable didnot work since the subreport fires after the main report.
Is there a way out?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top