Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

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
0
pemurray
Asked:
pemurray
1 Solution
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now