Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Check if record is unique to current line Post Reply Post New Topic
Author Message
pentesh
Newbie
Newbie


Joined: 03 Nov 2011
Online Status: Offline
Posts: 1
Quote pentesh Replybullet Topic: Check if record is unique to current line
    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.


Edited by pentesh - 03 Nov 2011 at 2:27am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.