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

Problem creating formula with "Previous" functin

Status
Not open for further replies.

dzavad

Programmer
Apr 17, 2000
167
US
I have formula that needs to be created. The logic is this:
Formula "ABC" Total_Group_field - 500 + previous(ABC), this formula doesnt work because i am reference formula to itself. And I am not sure how can I create this fromula to capture previous resault in the group section of the report.
 
Where in the group section, the header or the footer?

A previous of a field in the group footer would be the last value for that group, in the header would be the last value for the previous group except in the first group.

Rather than posting nebulous descriptions, try posting technical information:

Crystal version
Database/connectivity used
Example data
Expected result

-k
 
Assuming that Total_Group_field is is a summary field for a group in your report, try something like this:

Insert a section b in the group footer.

Create a formula called PreviousABC:
WhilePrintingRecords:
NumberVar PrevABC;
PrevABC:= Total_Group_Field - 500

Put formula PreviousABC in group footer b (the section below formula ABC).

Change formula ABC:
WhilePrintingRecords:
NumberVar PrevABC;
Total_Group_Field - 500 + PrevABC

The logic is to set variable PrevABC to
"Total_Group_Field - 500" and hold it for the next record.

I haven't tested this, but it should put you on the right track.

MrBill
 
Thanks a lot..it worked just fine.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top