troubleshooting Question

Need help with ACCUMULATION VARIABLE.....?

Avatar of Marcus Aurelius
Marcus AureliusFlag for United States of America asked on
Crystal Reports
8 Comments1 Solution593 ViewsLast Modified:
Experts:

I'm having a problem with a variable not accumulating correctly.

This is in GROUP HEADER:
//GF1
whileprintingrecords;
global numbervar APPROVEDACTAMT1:=0;


This is in DETAILS SECTION:

//ACCUMULATION FORMULA
whileprintingrecords;
global numbervar APPROVEDACTAMT1:=
IF({@Installment})="Activation" then
IF({@DisplayAttempts}) = '1' THEN
if({tblPaymentTransactionResult.resultCode})= '1'
then {tblPaymentTransaction.amt}+ APPROVEDACTAMT1
ELSE 0;



This is the display formula in GROUP FOOTER:

//GF1
whileprintingrecords;
global numbervar APPROVEDACTAMT1;


I think the problem may related to this formula that is a part of the ACCUMULATION formula that is in the DETAILS SECTION:

//@DisplayAttempts
whileprintingrecords;
Global numberVar intAttempts;
If OnFirstRecord OR {@Installment}
   <> Previous({@Installment}) then
      intAttempts := 1
else
If OnFirstRecord OR {Order_Details.OrderID}
   <> Previous({Order_Details.OrderID}) then
      intAttempts := 1
else
   intAttempts :=    intAttempts + 1;

If intAttempts >= 3 then
    "3"
else
    CStr(intAttempts,0);




OR ....IT could be an issue with the formula that I'm using to GROUP ON:
  (incidentally, I cannot use WHILEPRINTINGRECORDS as I get an error
     group chosen on a NON-RECURRING field)



//Frequency
//whileprintingrecords;
if ubound(split({tblProducts.ProductName},"-")) < 3
then "N/A"
else
if split({tblProducts.ProductName},"-")[3] = 'BW' then 'BW'
else if split({tblProducts.ProductName},"-")[3] = 'E2W' then 'BW'
else
if split({tblProducts.ProductName},"-")[2] = 'BW' then 'BW'
else if split({tblProducts.ProductName},"-")[2] = 'E2W' then 'BW'
else
if left({tblProducts.ProductName},3)='18M'
then split({tblProducts.ProductName},"-")[4]
else
if left({tblProducts.ProductName},3)='MPD'
then split({tblProducts.ProductName},"-")[2]
else
if left({tblProducts.ProductName},3)='DLU'
then split({tblProducts.ProductName},"-")[2]
else
split({tblProducts.ProductName},"-")[3]


I realize that this is not alot to go on...but let me know if you have questions......ANY AND ALL advice on WHY my ACCUMULATION FORMULA is not working would be much appreciated. The formula DOES start to accumulate, but It appears to reset itself to ZERO for no apparent reason.


Thanks
MikeV
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros