Question
I'm trying to calculate an average cost per report for each person in my main report from 2 subreports; one with total costs per person and the other counting the number of reports per person. Each report can have several costs and the only common field is name. I can calculate a cost but only using the last record from each subreport. How do I get it to use records from each group?
I'm using CR11 and MSaccess.
Explanation
I have declared shared variables as follows:
The costs variable (@sumcosts):
The reports variable (@countreps):
Main report calculation (@costperreport):
In each subreport I have tried used running totals and formulas (as you will see above) which are referenced to the variables above. They appear in the group footer and are both grouped under name {ROSusernames.fullname}.
I'm trying to calculate an average cost per report for each person in my main report from 2 subreports; one with total costs per person and the other counting the number of reports per person. Each report can have several costs and the only common field is name. I can calculate a cost but only using the last record from each subreport. How do I get it to use records from each group?
I'm using CR11 and MSaccess.
Explanation
I have declared shared variables as follows:
The costs variable (@sumcosts):
Code:
WhilePrintingRecords;
shared currencyVar sumcosts := sum({ROSdata.NetFee},{ROSusernames.FullName});
The reports variable (@countreps):
Code:
whileprintingrecords;
shared numbervar reportstot := {#Reptot};
Main report calculation (@costperreport):
Code:
shared currencyvar sumcosts;
shared numbervar reportstot;
sumcosts/reportstot
In each subreport I have tried used running totals and formulas (as you will see above) which are referenced to the variables above. They appear in the group footer and are both grouped under name {ROSusernames.fullname}.