cancel
Showing results for 
Search instead for 
Did you mean: 

Capture the last 2 values of a field in Crystal Reports

cothmer
Participant
0 Kudos

Is there a way to capture the last 2 values of a field in Crystal Reports either by formula or some other way. A persons weight can get documented multiple times a day, is there a way to get the last 2 values only to display on a report ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Create two formula

@Count

whileprintingrecords;

global numbervar n:=n+1;

@Countreset

whileprintingrecords;

global numbervar n:=0;

Place count in detail line and suppress

Place countreset in patient group header and suppress

In section expert go into the formula box on the Suppress section and enter this condition

whileprintingrecords;

{@Count}< count({anydetailfield}, {yourpatientgroupfield})-1

Ian