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!

Display previous group's summarized field 1

Status
Not open for further replies.

michbell

Technical User
Aug 12, 2004
25
US
I'm using CR 9 with Linux.

Sample data (grouped by Process):

GH:
Process Start Date End Date
A 8/1/05 8/3/05
B 8/2/05 8/6/05
C 8/7/05 8/8/05
D 8/11/05 8/12/05

start date = minimum({datefield}, {process})
end date = maximum({datefield}, {process})

I need to display the previous process's end date so that I can subtract this value from the start date like this:

GH:
Process Start Date End Date Prev. End Date Days
A 8/1/05 8/3/05
B 8/2/05 8/6/05 8/3/05 -1
C 8/7/05 8/8/05 8/6/05 1
D 8/11/05 8/12/05 8/8/05 3

The Previous function won't work (it says "This field has no previous or next value") I think because it's a summarized field in the group header and not the details section.

Any thoughts? Thanks in advance!
 
Have you tried a variable yet?

Make the following formulas:



@dtPreviousdisplay=
shared datetimevar dtPrevious;
dtPrevious;
---------
@dtPreviousUpdate=
evaluateAfter({@dtPreviousdateDisplay});
shared datetimevar dtPrevious;
dtPrevious:= (your end date formula)



Note two things about it; shared variable, and the evaluate after. The reason for the evaluate after is so that the display occurs first and then the value gets updated.
The reason for the shared versus global variable has to do with evaluation order in the report.

I'm pretty sure this will work, if not you can always come back.

Good luck with that.

Scott
 
Thanks for the help, Scott. It worked great! I appreciate it. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top