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

calculating variances from subreports?

Status
Not open for further replies.

ridhirao22

Programmer
Aug 27, 2010
140
US
I am working on a report and has a subreport where I will need to find variance between the subreport value and the mainreport values.

Report is group by store#

Date, Store #, store name, saleamt1, saleamt2, varaiance (saleamt1-saleamt2) Saleamt3(subreport) variance(saleamt1-saleamt3)

How can I find the variance between the main report value (saleamt1) and Subreport values (saleamt3)

I have tried the logic from another thread –( thread767-1382752)

Sub report works fine but in the main report the the first value for the store# is showing up as zero. I can’t figure what I am doing wrong please advice.

In my subereport
@Finsales is placed in the RF in the subreport and suppressed section.

whileprintingrecords;
shared numbervar FinSales:= sum(finamt, store#);

In my main report
@variance placed in GF
whileprintingrecords;
shared numbervar FinSales;
sum(saleamt1,store3) – finsales

@reset placed in GF
whileprintingrecords;
shared numbervar FinSales:=0;

TIA,
RR
 
Make sure that the subreport for each group runs in a section prior to the section where you're calculating the variance.
For example, split the group footer in to GF1a and GF1b.
Place the subreport into GF1a, so that the calculations will be complete.
Place the formula where you'll be calculating variance into GF1b.


Bob Suruncle
 
Thank you Sir Bob. appreciate you reply.

I was confused on where to reset the variable to zero...from your reply I split the GF1 to a,b,c sections and it works ok so far.

Thanks again!
RR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top