Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Select rows where data changes Post Reply Post New Topic
Author Message
julie r.
Newbie
Newbie


Joined: 07 Apr 2010
Location: United States
Online Status: Offline
Posts: 2
Quote julie r. Replybullet Topic: Select rows where data changes
     Posted: 07 Apr 2010 at 4:19am

I'm writing a report to track the changes (within a date range) to the department number to which employees are assigned.  I want to group by empl id and select only the rows where the dept id changes from one row to the next(within each group).  Is it possible to select only rows in a report where a certain field changes?  If so, could someone please give me some suggestions on how to accomplish this?  Thanks!

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Apr 2010 at 4:21am
you can conditionally suppress using
next(field)<>field
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Apr 2010 at 4:38am
If you want to show both rows, you'll need to check the Suppress checkbox on the section and then take DBlank's answer one step further.  Set the suppress formula to :
 
(next(field) <> field)  or (previous(field) <> field)
 
This will "unsuppress" any rows that show the difference.
 
-Dell
IP IP Logged
chris
Newbie
Newbie


Joined: 02 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote chris Replybullet Posted: 07 Apr 2010 at 4:56am
You may also have to consider adding some code to the formula above to ensure that you are not comparing the last record of one group with the first record of the next group.
 
My reports for example, use person_id=next(person_id)
 
Chris
IP IP Logged
julie r.
Newbie
Newbie


Joined: 07 Apr 2010
Location: United States
Online Status: Offline
Posts: 2
Quote julie r. Replybullet Posted: 07 Apr 2010 at 5:34am
Thanks ya'll it's working now!  Appreciate the help
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