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

Problem with Grand total with variable 1

Status
Not open for further replies.

fsreport

Programmer
Mar 23, 2007
128
US
hi All
Ms. SQl
Cr 9.0
I need youe help on this declared variable
i have one for
Territory like this
//{@reset} to be placed in the territory GH:
whileprintingrecords;
numbervar cntforterr := 0;

//{@accum} to be placed in the contact ID group footer:
whileprintingrecords;
numbervar cntforterr := cntforterr + {#GroupCount};

//{@display} to be placed in the territory group footer:
whileprintingrecords;
numbervar cntforterr;
sum({@SaleSMA}, {table.territory})/cntforterr
*********************************************

for Channel if have this
//{@resetchannel} to be placed in the channel GH:
whileprintingrecords;
numbervar cntforchannel;
if not inrepeatedgroupheader then
cntforchannel := 0;

Change {@accum} to:
//{@accum} to be placed in the contact ID group footer:
whileprintingrecords;
numbervar cntforterr := cntforterr + {#GroupCount};
numbervar cntforchannel := cntforchannel + {#GroupCount};

Then create a new formula to display the result in the channel group footer:

//{@displchannel}:
whileprintingrecords;
numbervar cntforchannel;
************************************
I need to create one now for grand total

Can someone show me how to

Thanks






fsreport
 
Please DO NOT start a new thread on the same topic. This is the third or fourth thread now, I think. You are implementing this incorrectly. The point of showing you the code is for you to learn how to use it yourself and I think you should have been able to generalize from the previous code.

Anyway here are the only formulas you need. Eliminate the others:

//{@reset} to be placed in the territory GH:
whileprintingrecords;
numbervar cntforterr;
if not inrepeatedgroupheader then
cntforterr := 0;

//{@resetchannel} to be placed in the channel GH:
whileprintingrecords;
numbervar cntforchannel;
if not inrepeatedgroupheader then
cntforchannel := 0;

//{@accum} to be placed in the contact ID group footer:
whileprintingrecords;
numbervar cntforterr := cntforterr + {#GroupCount};
numbervar cntforchannel := cntforchannel + {#GroupCount};
numbervar gt := gt + {#GroupCount};

//{@displterr} to be placed in the territory group footer:
whileprintingrecords;
numbervar cntforterr;
sum({@SaleSMA}, {table.territory})/cntforterr

//{@displchannel} to be placed in the channel group footer:
whileprintingrecords;
numbervar cntforchannel;
sum({@SaleSMA}, {table.channel})/cntforchannel

//{@displgt} to be placed in the report footer:
whileprintingrecords;
numbervar gt;
sum({@SaleSMA})/gt

Please study the code and if you have questions about what it is doing, please ask.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top