Solved

Suppress Duplicate Records Crystal Reports

Posted on 2011-02-28
10
860 Views
Last Modified: 2012-05-11
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.

0
Comment
Question by:nobile00
  • 5
  • 4
10 Comments
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997495
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 Comment

by:nobile00
ID: 34997539
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
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997555
Most likely.  What does those formulas look like?
0
 

Author Comment

by:nobile00
ID: 34997608
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
 
LVL 12

Expert Comment

by:JayConverse
ID: 34997853
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:nobile00
ID: 34997984
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
 
LVL 12

Accepted Solution

by:
JayConverse earned 500 total points
ID: 34998062
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 34998444
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 Comment

by:nobile00
ID: 34999083
Thanks for checking in MLMCC the above solution from Jay worked.  
0
 

Author Closing Comment

by:nobile00
ID: 34999089
Jay this worked a little bit tedious but overall it worked.

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Report Error 14 73
Selection formula 7 51
Speed Up Crystal Report 5 48
Crystal Reports condense field in detail section when null without formula 2 45
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now