Solved

Highlight Duplicate Data in Sorted Datawindow

Posted on 2006-06-26
2
377 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:pemurray
2 Comments
 
LVL 4

Accepted Solution

by:
batchakamal earned 500 total points
ID: 16985553
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
 

Author Comment

by:pemurray
ID: 17010504
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

867 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

14 Experts available now in Live!

Get 1:1 Help Now