Skip to Content

Capture the last 2 values of a field in Crystal Reports

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 ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 19, 2017 at 07:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded