Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress Duplicate Records in GF Post Reply Post New Topic
Page  of 2 Next >>
Author Message
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Topic: Suppress Duplicate Records in GF
     Posted: 15 Oct 2012 at 10:33am
CR 10 Pro
How does one suppress duplicate records if one of the fields is repeated (account name) and the data is listed in GF1?
 
Example data:
Account No.  Account Name  Rep
101              ABC                   John
102              XYZ                   Sally
103              XYZ                   Sally
104              XYZ                   Sally
105              DEF                   Joe
 
Would like to suppress to display
101              ABC                   John
102              XYZ                   Sally
105              DEF                   Joe
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Oct 2012 at 11:42am
You can suppress the section using a previous() function in a formula
Previous(table.account_name_rep)=table.account_name_rep


Edited by DBlank - 15 Oct 2012 at 11:43am
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 15 Oct 2012 at 11:47am
I assumed the formula should be used in replacement of the actual field and now I'm getting true and false records instead of the actual record. Should it be placed elsewhere?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Oct 2012 at 11:50am

open the section expert

select the section you want suppressed (GF)
click on the formula button (X-2)
add your condition here.
If the formual returns a TRUE is suppresses the section, FALSE shows the section
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 15 Oct 2012 at 12:01pm
Excellent - that worked like a charm! Now if you can just get my cat to not eat my fish that would be even better )
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Oct 2012 at 3:51am
Right click on the fish
select properties
select common tab
mark the 'edible' box as False
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 16 Oct 2012 at 6:19am
I tried that but the cat was too smart, he hacked my changes )
 
Apparently the filter is working too well now, it seems to be filtering out accounts that should be displaying. I placed this formula under the "suppress" section of GF1, did I do it incorrectly?
 
Previous({tblAccounts.AccountName})={tblAccounts.AccountName}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Oct 2012 at 7:34am

to test the scenario remove the suppress formula and just add a new formula field witth same code and palce it on the footer.

You will see it return true/false so you can see what it is doing.
Can you show an example of what where it went wrong?
Also if you have a code instead of a name string it is better to use that in case there are duplicatee names that are really 2 people.
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 16 Oct 2012 at 12:10pm

So I followed your suggestion and I see the accounts that now that were suppressed, here's some of the output:

Acct No. Acct Name Rep
47         Avesis        MikeM
False
 
40833   Avesis 1     MikeM
True
 
46718   AWE Corp. House
True
 
42229   B&B Blinds  RobertL
True
 
Neither Avesis account shows up when I use the suppress formula


Edited by rlivermore - 16 Oct 2012 at 12:11pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Oct 2012 at 4:24am
Odd.
Th fact that you get a false on AVIESIS should mean it would not suppress.
IP IP Logged
Page  of 2 Next >>
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