Print Page | Close Window

Eliminate duplicates

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11490
Printed Date: 19 May 2024 at 2:54am


Topic: Eliminate duplicates
Posted By: Zuzanna
Subject: Eliminate duplicates
Date Posted: 21 Oct 2010 at 10:20am
Hi,
I am eliminating duplicate rows by using the section expert, selecting the detail section and adding the following formula next to the suppress no drill down option.
 
((Next({SJ000174.EMPLID}) =  {SJ000174.EMPLID}  And

Next({SJ000174.LAST_NAME})  = {SJ000174.LAST_NAME} And

Next({SJ000174.FIRST_NAME}) = {SJ000174.FIRST_NAME} And

Next({SJ000174.NATIONAL_ID}) = {SJ000174.NATIONAL_ID}  And

Next({SJ000174.LHS_DEPT_DESCR}) = {SJ000174.LHS_DEPT_DESCR} And

Next({SJ000174.LOCATION}) = {SJ000174.LOCATION} And

Next({SJ000174.REG_TEMP}) = {SJ000174.REG_TEMP}  And

Next({SJ000174.FULL_PART_TIME}) = {SJ000174.FULL_PART_TIME} And

Next({SJ000174.LHS_CONTRACT_DESCR}) ={SJ000174.LHS_CONTRACT_DESCR} And

Next({@POSITION TITLE}) = {@POSITION TITLE} And

Next({SJ000174.BUSINESS_UNIT}) = {SJ000174.BUSINESS_UNIT} And

Next({SJ000174.DEPTID}) = {SJ000174.DEPTID} And

Next({SJ000174.UNION_CD}) = {SJ000174.UNION_CD})

 
This code eliminates a duplicate row only. Is there a way how I can eliminate both rows from the report if they are identical. The rows were selected through SQL because another field that I am not pulling into crystal has changed and therefore the effdt has changed. I don't want to see either of the rows on the report if rows are identical.
 
Thanks.



Replies:
Posted By: lockwelle
Date Posted: 22 Oct 2010 at 2:44am
I would think that OR in your formula with a duplicate but changing Next to Previous would work...  It's what I would try.
 
Preferable to this would be to eliminate them in the SQL select, so that you don't have to deal with them at all.
 
HTH


Posted By: Zuzanna
Date Posted: 22 Oct 2010 at 5:30am
Hi,
I realize that changing the SQL query would be the best, I needed to do a quick fix(the underlying query is too complicated). I tried what you suggested using Previous and it worked, I also had to use NOT OnFirstRecord and NOT OnLastRecord to get the first and last row printed. 
 
Many thanks.



Print Page | Close Window