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

Grab Value from Previous Record

Status
Not open for further replies.

MKVAB

Programmer
Dec 2, 2003
86
US
Hello to all!

I have a report that is grouped by number of payments a certain customer type has made. So, first there's a group for CustomerType, then PaymentNo. In the PaymentNo group there is a field COUNT(PaymentNo) to get how many of the CustomerTypes have made this certain number of payments.

The problem: For reasons that would be difficult to explain, I need to display the COUNT(PaymentNo) in the group with the value of the previous record.

Example (Actual Values):
-----------
CustomerTypeA
Payment1 15
Payment2 12
Payment3 9
Payment4 7


Example (What is needed):
-----------
CustomerTypeA
Payment1 -
Payment2 15
Payment3 12
Payment4 9
Payment5 7

I have looked into the PREVIOUS function but I have been unable to get it to work for me. When I try to apply PREVIOUS to my formulas it tells me "No Previous or Next Value". I am now trying to get some variation of Running Totals to work for me, but no success as of yet.

Can somebody give me a nudge in the right direction? Should I be looking into Running Totals, Previous function maybe using variables?

Any suggestions appreciated.
-Mary Klaire

 
You could add a formula named savetype to save the type in a variable.

whileprintingrecords;
shared numbervar saveprevtype := tablename.typefieldname

___

Then use another formula named printsavetype to print the variable on the next line.

whileprintingrecords;
shared numbervar saveprevtype;
saveprevtype
 
Thanks MColeman!

I was just looking into that. My apologies, I should have searched the forums better prior to posting. See string thread767-588801.

I will try to apply this solution to the group level for my report.

Thanks again.
-Mary Klaire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top