# Suppress Duplicate Records Crystal Reports

Hi

I have a sub-report that has 4 formulas and want to suppress a record if it is duplicated.  For example this is one of the formulas:
if  {ACC_REPORT_DP_S.FLAG_RANGE} = "H" then "H:High"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "L" then "L:Low"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "HP" then "HP:High Panic"
else if {ACC_REPORT_DP_S.FLAG_RANGE} = "LP" then "LP:Low Panic"

When the report is run it can display H: High many times I only want to display it once.  Is there a way to suppress duplicate records when using a formula/

Any help is greatly appreciated.

Asked:
###### Who is Participating?

Commented:
Then you could have four formulas like this:

HCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "H" then 1 else 0;
LCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "L" then 1 else 0;
LPCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "LP" then 1 else 0;
HPCount: if {ACC_REPORT_DP_S.FLAG_RANGE} = "HP" then 1 else 0;

Then create 4 running totals that sum each of the Count fields.  Then your suppression formula would be more like:

{#myrunningHtotal} > 1 or {#myrunningLtotal} > 1 or {#myrunningLPtotal} > 1 or {#myrunningHPtotal} > 1
0

Commented:
There are a couple ways, depending on what you're trying to accomplish.  One is to create a running total that counts details, and suppresses when the counter is > 1 and {ACC_REPORT_DP_S.FLAG_RANGE} = "H".  Another way is to group by {ACC_REPORT_DP_S.FLAG_RANGE}, and only print the group header, not the details.
0

Author Commented:
I tried grouping but that didn't work.  There are 4 formulas that have the same type formula but are coming from 4 different fields in the database.  The other formulas are for flag too.  Would I be able to use a counter with the 4 formulas?
0

Commented:
Most likely.  What does those formulas look like?
0

Author Commented:
Here are the other 3 formulas:

1. if {ACC_REPORT_DP_S.FLAG_ALERT} = "A" then "A:Alert"
2. if {ACC_REPORT_DP_S.FLAG_EXCLUSION} = "E" then "E:Exclusion"
3. if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dp+" then "Dp+: Positive Delta from Previous Visit"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dp-" then "Dp-: Negative Delta from Previous Visit"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db+" then "Db+: Positive Delta from Baseline"
else if {ACC_REPORT_DP_S.FLAG_DELTA} =  "Db-" then "Db-: Negative Delta from Baseline"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dbp+" then "Dbp+: Postive Delta from Baseline and Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Dbp-" then "Dbp-: Negative Delta from Baseline and Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db+Dp-" then "Db+Dp-: Positive Delta from Baseline and Negative Delta from Previous"
else if {ACC_REPORT_DP_S.FLAG_DELTA} = "Db-Dp+" then "Db-Dp+: Negative Delta from Baseline and Positive Delta from Previous"

0

Commented:
Those are vanilla formulas, they won't interfere with anything.   Make a simple running total that counts occurrences of any field in the detail record, then in the detail sections suppression formula put '{#myrunningtotal} > 1 and {ACC_REPORT_DP_S.FLAG_RANGE} = "H"'.  Just be sure to reset the running total at an appropriate sort break.
0

Author Commented:
Also, there can be duplicates for any of the records not just High it could have multiples of Low LowPanic etc. I not sure the above will work I will give it a try.
0

Commented:
Is this for the entire report or do you have the data grouped in some way?

Are you suppressing just the display of that value or the display of the entire record based on 1 or more fields?

mlmcc
0

Author Commented:
Thanks for checking in MLMCC the above solution from Jay worked.
0

Author Commented:
Jay this worked a little bit tedious but overall it worked.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Already a member? Login.

All Courses

From novice to tech pro — start learning today.