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!

Formula Breakdown

Status
Not open for further replies.
Apr 26, 2005
29
US
Hello,

I am not a crystal guru by any means and I do not understand alot of the language. I have a crystal report which was built by another party, and I am trying to figure out what this formula is saying in english. I know which tables it is looking at in my erp system, I just don't understand the logic.

If anyone could break this down into english I would appreciate it. Thanks

stringvar invoice;
stringvar evalinv:="no";
stringvar trantype;
stringvar evaltran:="no";
stringvar sequencet;
stringvar evalseqt:="no";

if {AR6_TransPaymentHistory.TransactionType} = "P" then invoice:={AR6_TransPaymentHistory.PymntReferenceCheckNumber}
else invoice:={AR6_TransPaymentHistory.InvoiceNumber};
trantype:={AR6_TransPaymentHistory.TransactionType};
sequencet:={AR6_TransPaymentHistory.SeqNumber};

iF {AR6_TransPaymentHistory.TransactionType} IN ["I","D","A","C","F"] THEN
if invoice = next({AR6_TransPaymentHistory.InvoiceNumber}) then evalinv:="yes";
If trantype = next({AR6_TransPaymentHistory.TransactionType}) then evaltran:="YES";
If sequencet = next({AR6_TransPaymentHistory.SeqNumber}) then evalseqt:="yes";

iF {AR6_TransPaymentHistory.TransactionType} IN ["P"] THEN
if invoice = next({AR6_TransPaymentHistory.PymntReferenceCheckNumber}) then evalinv:="yes";
If trantype = next({AR6_TransPaymentHistory.TransactionType}) then evaltran:="YES";
If sequencet = next({AR6_TransPaymentHistory.SeqNumber}) then evalseqt:="yes";

If evalinv = "yes" then
If evaltran = "YES" then
if evalseqt = "yes" then "SKIP
 
Hi,
Well sort of:

The ultimate result wil be either NULL or SKIP for the formula's output and that is dependent on the code above it which:
First:
Based on the Transaction type, sets a variable called invoice to a check number or an Invoice number.
It also sets 2 string variables to values from the database fields specified.

Then:
Based on the Transaction type, it checks the NEXT record coming from the database and, based on the values it finds, sets the 3 eval.. string variables to 'yes' or leaves them set to their initial value of 'no'.

Then, at last,[yawn]
if all of those eval.. string variables have been set to 'yes', it returns 'SKIP', which must cause something to happen when it is not null.

As to whether it all works, that is another, data-dependent story...







[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thank you,

I was not sure what the "next" function was doing. That helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top