cancel
Showing results for 
Search instead for 
Did you mean: 

Report based on conditon of previous record

Former Member
0 Kudos

Can anyone help...

I am trying to write a crystal report v9 to report on the next record in the table based upon the outcome of the previous record. For example table1 has 3 fields which I wish to use

Field1; Field2; Field3

1) 11 A Y

2) 25 B N

3) 45 C N

4) 64 B Y

5) 100 D N

I want the report to evaluate each line so that when field 3 is equal "Y" it returns the line below i.e. line 2. When field 3 was equal to N to keep reading down the table until line 4 until the condition was true again and report on line 5 etc. Until the end of the table. Then I wish to group by field 2.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if ="Y" THEN IF PREVIOUSISNULL( ) THEN ELSE PREVIOUS( )

ELSE

Regarsd,

Sathish

Edited by: Sathish Chandran on Mar 31, 2009 11:38 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Try this formula

if ="Y" then

previous() else next()

Regards,

Raghavendra