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

Cannot summarize a formula

Status
Not open for further replies.

springle

IS-IT--Management
Jan 7, 2005
7
I have a fairly harmless formula that is giving me the numbers I expect. The problem is that I cannot apply a summary to this field. If I try to trick crystal 9 into doing a summary I get an erro stating, "A summary has been specified on a non-recurring field."

Any ideas what it causing this and how to get around it.

Thanks in advance. Below is the formula

Scott

===== Start Formula ======
if 99/100 <= 1.0 then
(if {CONTACT2.USLSQTPROD} startswith "1" then (135 * {@PercentofQuotaMet}/100)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 50 * {@PercentofQuotaMet}/100)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 20 * {@PercentofQuotaMet}/100)
)

else if {@PercentofQuotaMet}/100 <= 1.2 then
(if recordnumber <= {@SalesQuota} then
(if {CONTACT2.USLSQTPROD} startswith "1" then (135 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 50 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 20 * 1.0)
)
else if recordnumber <= {@SalesQuota} * 1.2 then
(if {CONTACT2.USLSQTPROD} startswith "1" then (160 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 60 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 25 * 1.0)
)
)

else
(if recordnumber <= {@SalesQuota} then
(if {CONTACT2.USLSQTPROD} startswith "1" then (135 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 50 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 20 * 1.0)
)
else if recordnumber <= {@SalesQuota} * 1.2 then
(if {CONTACT2.USLSQTPROD} startswith "1" then (160 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 60 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 25 * 1.0)
)
else
(if {CONTACT2.USLSQTPROD} startswith "1" then (200 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "2" then ( 80 * 1.0)
else if {CONTACT2.USLSQTPROD} startswith "3" then ( 40 * 1.0)
)
)

====== End Formula ======
 
One problem is your use of recordnumber, which is a special field based on sequence/sort order across records, and which therefore prevents the summary. We would also need to see the contents of {@SalesQuota} and {@PercentofQuotaMet} to know whether there are any other factors preventing the inserted summary.

You should, however, be able to use a variable to summarize the formula. If you are only looking for a sum at the grand total level, then use two formulas:


//{@accum} to be placed in the same report section as your formula:
whileprintingrecords;
numbervar sumx := sumx + {@yourformula};

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

If you want the result at a group level, place {@display} in the group footer, and add a reset formula for the group header:

//{@reset}:
whileprintingrecords;
numbervar sumx;
if not inrepeatedgroupheader then
sumx := 0;

-LB
 
Sorry for the delay. I manually created formulas to replace the recordnumber function as well as the group summaries and all is well. Thank you for the push in the right direction.

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top