Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Supress value if duplicated - but.. Post Reply Post New Topic
Author Message
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Topic: Supress value if duplicated - but..
     Posted: 06 Mar 2014 at 1:31am
Hi,

I am trying to supress duplicate rows if the results are the same as the previous. Is there a way to query the whole row to check if its a duplicate rather than just one field? As potentially multiple fields could be the same apart from one value which would indicate this is actually a separate result not a duplicate example below:

ID Date        PurchasedBy    Item    Description Qty
1   01/01/2013   user1          Item A    1        20
1   01/01/2013   user1          Item A    1        20
1   01/01/2013   user1          Item B    1        20

If I create a section expert on the Supress no drill-down {table.item}=previous({table.item})

I still get duplicates :(


Edited by shabbaranks - 06 Mar 2014 at 1:32am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 07 Mar 2014 at 4:25am
shared variables, come in groups of 3, though this case would be slightly different...probably just 2 needed, and the suppression formula

in the group header: reset
shared stringvar x:= ""
""//hides any numbers you might need to reset

increment/suppression: Detail level...section expert
shared stringvar x; //match the variable names
local booleanvar result;
result := (x = {table.field1})
and (other fields);
x:={table.field};
//and other fields
result;


should work.
good luck
IP IP Logged
otto
Groupie
Groupie


Joined: 17 Mar 2014
Online Status: Offline
Posts: 53
Quote otto Replybullet Posted: 20 Mar 2014 at 4:53am
another thing you can do is converting to string the 5 columns and create a group based on that string
for example put inside {@fromula1)
totext(ID)+totext(Date)+PurchasedBy+Item+Description+totext(Qty) and group based on that formula
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Mar 2014 at 4:59am
otto's suggestion would work as well...then you would display only the group header or the group footer, since any detail lines would be, by definition of the group, duplicates, and you don't want to see them.
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