Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Record Selection based on value in previous record Post Reply Post New Topic
Author Message
TonyM70
Newbie
Newbie


Joined: 06 Apr 2011
Online Status: Offline
Posts: 9
Quote TonyM70 Replybullet Topic: Record Selection based on value in previous record
     Posted: 11 May 2011 at 3:52am

I am trying to include/exclude records based upon a value from the previous record.

I have attempted to modify record selection formulas by using Previous() or Next() print state functions but receive error msg indicating that the function cannot be used it must be evaluated at a later time.
 
Was also thinking of trying to indirectly supress the record with formulas - but feel this would be very convoluded, even if it is possible - trying to avoid creating something that would not be considered good practice or design.
 
Below is simplified dataset and desired condition. I would expect records from rows 3-5 to be displayed in the report. FYI col x is shown here for clarity it is not present in actual dataset:
 
x      RemQty     RemAvail
 
1         0                 26
2         20               6
3         25               -19
4         18               -37
5         29               -66
 
IF
         For x = 1   RemQty(x) >= RemAvail(x) or
         For x > 1   RemQty(x) >= RemAvail(x-1) TRUE include record
ELSE exclude record
 
Thanks in advance for any assistance.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum