Highlight Duplicate Data in Sorted Datawindow

Greetings All,

We have a data cleansing project going on.

I would like to create a datawindows that retrieves data either from a database or import the data from a spreadsheet.

I would like to create a computed field to check on the value of one field (employee ID) to see if it is a duplicate.

I plan to sort the datawindow by employee id.

In the computed field or in the backcolor property for employee id, I would like to enter an expression that checks to see if the value of the field in the previous row or the next row is the same.

I don't really know how to refer to another row in a datawindow expression.

So I was thinking that it could be something like:

     if(emp_id = (getrow + 1(emp_id)), rgb(0,0,0),rgb(255,255,255))

What I don't know is how to get the value of emp_id from the next row down.

Can anyone help here.  I would prefer not to have to write a function for this as the datawindows will be throw aways.

Thanks!!

Paul
pemurrayAsked:
Who is Participating?
 
batchakamalCommented:
Yeah it is simple
Choose all the columns,
Go to the Font properties page,

Write the following in the Background color expression

if(  emp_id  [0] =  emp_id  [1] , rgb(255,0,0), rgb(255,255,255))

Cheers!!!

0
 
pemurrayAuthor Commented:
Hi Batchakamal,

Perfect Answer!!  Works great.

Now is that stuff undocumented?  I don't ever recall seeing documentation in PB to do something like that.  Actually, I don't even understand how it works.  Is the [0] and [1] an array reference or something else?

Thanks again!!

Paul
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.