Solved

Suppress Duplicate Records Crystal Reports

Posted on 2011-02-28
10
846 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
Comment Utility
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
Comment Utility
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
Comment Utility
Most likely.  What does those formulas look like?
0
 

Author Comment

by:nobile00
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:nobile00
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for checking in MLMCC the above solution from Jay worked.  
0
 

Author Closing Comment

by:nobile00
Comment Utility
Jay this worked a little bit tedious but overall it worked.

Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

7 Experts available now in Live!

Get 1:1 Help Now