Print Page | Close Window

Check if record is unique to current line

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14854
Printed Date: 02 May 2025 at 12:38am


Topic: Check if record is unique to current line
Posted By: pentesh
Subject: Check if record is unique to current line
Date Posted: 03 Nov 2011 at 2:27am
Hi

I am wondering if it is possible through formula / SQL to have a field which states whether or not a record is unique from the current line down to the end of the range. I need to do this based on a check against one field and based on two fields as well.

I am sure this makes no sense so I will show an example of the excel formulae I currently use to calculate this:

Single field check against column A over a 10,000 line record set.

=IF(COUNTIF(A2:$A$10000,A2)=1,1,0)

Two (or more) field check against column A & B over a 10,000 line record set.

=IF(COUNTIFS(A2:$A$10000,A2,M2:$M$10000,M2)=1,1,0)

When I drag this down against the record set it returns a 1 or 0 as appropriate.

Thanks for the help.



Replies:
Posted By: DBlank
Date Posted: 07 Nov 2011 at 4:47am

assuming you do not want to use grouping you cannot check later rows against the current row (other than the immediate next row) but you could check a row against all previous rows using a variable. YOu would build an formula to make an ever growing string that added your current value to it and also checking the current field against that string. to see if had been used before

like this
http://crystalreportsbook.com/Forum/forum_posts.asp?TID=14775 - http://crystalreportsbook.com/Forum/forum_posts.asp?TID=14775
 



Print Page | Close Window