Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Unwanted duplicates reappear when put into groups Post Reply Post New Topic
Author Message
rosieclaws
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 4
Quote rosieclaws Replybullet Topic: Unwanted duplicates reappear when put into groups
     Posted: 13 Oct 2011 at 3:47am
I am new to crystal and slowly working it out! I have a large amount of data that has numerous dates over many years for lots of different items.
 
I have managed to get the latest date for each item by sorting the data and suppressing the information if the items are repeated (using previous command in formula).  However I then needed to separate into groups according the latest date so now the previous suppressing formula doesn't work and I have the same item in different groups of my report. If there a way I can make sure I have a record for each item with its latest date?
 
I would be grateful of any help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Oct 2011 at 3:52am
can you post some sample data and how you want it to appear after grouping please?
IP IP Logged
rosieclaws
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 4
Quote rosieclaws Replybullet Posted: 13 Oct 2011 at 4:02am

Thanks for your quick response

I have data like this:
 
Group - Seen before 2010
 
Reference                        Date
 
3                                      30/03/2007
6                                      10/08/2009
8                                      15/09/2008
10                                    22/06/2008
 
Group - Seen in orafter 2010
 
3                                       15/04/2010
4                                       16/08/2011
5                                       19/06/2010
6                                       11/01/2010
 
Where items 3 and 6 had multiple dates and appear in both groups. I just want the information about the latest date e.g.
 
Group - Seen before 2010
 
Reference                        Date
 
8                                      15/09/2008
10                                    22/06/2008
 
Group - Seen in or after 2010
 
3                                       15/04/2010
4                                       16/08/2011
5                                       19/06/2010
6                                       11/01/2010
 
Hope that can be understood!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Oct 2011 at 5:37am
don't think you can do this without running a subreport.
If you could create your own views or stored procedures you could likely get the data to support the design but not as is.
if you group on ID you can do it.


Edited by DBlank - 13 Oct 2011 at 5:37am
IP IP Logged
rosieclaws
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 4
Quote rosieclaws Replybullet Posted: 18 Oct 2011 at 5:39am
How would I do it with a subreport?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Oct 2011 at 7:24am

in your sample you would run two subreports

group on reference
do a summary of maximum(date,reference)
for the first group (subreport 1) do a group select as
maximum(date,reference)<date(2010,1,1)
for the second group (subreport2) invert it
maximum(date,reference)>=date(2010,1,1)
IP IP Logged
rosieclaws
Newbie
Newbie


Joined: 13 Oct 2011
Online Status: Offline
Posts: 4
Quote rosieclaws Replybullet Posted: 19 Oct 2011 at 3:08am
Many thanks, I have managed to get the two lists now.
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