Solved

Highlight Duplicate Data in Sorted Datawindow

Posted on 2006-06-26
2
376 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

757 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

20 Experts available now in Live!

Get 1:1 Help Now