Jump to content

Selecting unique records


This topic is 2210 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

Im trying to write a script to select unique records from a table (see below). WIth no result :( . On this particular example script should select only records 1,2,3,6. 

 

image.png.609b8a237a799c8bb6949ba4feef290a.png

Link to comment
Share on other sites

Hello spand, 

Please use real names for things like fields, scripts, relationships etc., when posting a question. Please review the Anatomy of a Good Topic, and pay close attention to Steps 5, 6, 7, and 8.

2 hours ago, spand said:

On this particular example script should

What script? What steps are in your script? 

Did you know that, if you perform a find manually, it can be used in your script?

Why not post a copy of your file, or a mockup of it showing everything involved ?

Lee

Link to comment
Share on other sites

Here is one example.

Concatenate the fields that you determine need to be unique. A&B&C  then a self join relationship that test for the Num = Min ( showUnique::num)  will always show 1 if it is the first one of any duplicate records.

Find 1 in the isUnique field.

this method does require schema change (fields & table occurrence) a complete scripted method is possible too. 

unique.fmp12.zip

Link to comment
Share on other sites

Thanks Ocean West,

I read about self join relationship method. However, I'd like to learn to script this.

I added calculated filed with A&B&C. I watned to check record against a previous one and flag it in "duplicate" filed.  But it wont work if the same fileds are not one after another. 

example1.fmp12

Link to comment
Share on other sites

This topic is 2210 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.