Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Okay, I'm going nuts here  I'm trying to do a 2-criteria search:

Find all records which have

1) Duplicate values in Field A

AND

2) in which Field B is Empty for two or more *of those duplicates*

In other words, I'm trying to find pairs (or trios, etc) of records that have matching values for Field A, and for which Field B is Empty.

Can anyone instruct me on the right formulation for this find?

Posted

assuming field A and B are in the same table and not looking at related fields.

In find mode

  • put ! in field A and put = in B

or you can find for ! in a then once you find that set find again and put = in B and select constrain found set.

 

 

Posted

That was my first approach )both ways) . . . but it just isn't working!  I get a set of 2476 records (out of around 28,000), and while some of the desired pairings are in there, the vast majority are non duplicates.  I when I perform a Sort on Field A, I'm not getting sequences of film pairs with the same Field A value!  

When I simply seek duplicates in Field A, it works fine --  get 16,617 records and after sorting I'm not getting any singletons.

When I simply seek Field B = Empty I get 14,085 - fine

. . . but something's going amiss in the constraining step that I just can't make sense of.  

These are both simple text fields placed on the layouts as simple Edit boxes. 

I've even tried entering a 'Q' in Field B for all the empty Field B records so I could do an affirmative search for Duplicates in Field A and Q in Field B . . . sill get the same 2476 records.  I'm going nuts here!

Posted

Hey,

If you have access for creating fields, you could make a field with calculation.

After sorting your record in the right way, in the calculation make

If (value = GetEniemeRecord (french name) (value ; GetCurrentRecord Number - 1)

and

field b =

; 1; 0

Then search for every field C with 1 value.

i made an example

 

Tom

 

duplicate.fmp12

Posted

Thanks -- I'll give that a try if I can't figure out why the simpler Find process isn't working . . . there must be something going on here . . . ?

Posted

I can say with confidence it is not a matter of the sort.  I can take the Field A Value for many of these 2476 'hits' and just do a simple search for that value and see that whether there are say 2, or 3 or 9 'duplicates' for that field, there remains only a single one whose Field B is empty! 

Posted (edited)

Tom, I just checked out the helpful file you provided and discovered that I'm not conveying what I'm trying to achieve.  I'm trying to get ONLY PAIRS (or trios etc.) of records that

(a) SHARE  the Field A Value

AND

(b) Have EMPTY Field B's 

So in your File, I do not want to get a hit on the 'a' record with a blank field_b.

I DO want to get the TWO 'B' records

. . . in the image below, I want ONLY the two records at the bottom of the list, not the 4th record.

duplicates.jpg

. . . having it laid out like this makes it easier to see why my 2-step approach isn't working . . .but I'm still not finding my way to what will work!

Edited by Wickerman
Posted (edited)

There's a quirk in the way Filemaker finds duplicates when there's a constrain involved.   I know your pain.  In the past I spent many hours trying to understand why and finally saw the answer.  If you remove the index from the field where duplicates are being found, it should solve the problem.

I came to the conclusion that Filemaker internally takes advantage of indexing (if it exists) when it searches for duplicates, and the duplicates it comes up with are always across the ENTIRE Table.  Unfortunately found sets are ignored!   However if there's no index, Filemaker will properly constrain itself to the found set when it looks for duplicates.

To turn off indexing make sure automatic indexing is turned off as well as specifying NO index.  If you really need indexing to remain on this field, just create another (unindexed) calc field based on it, and use it instead.

Edited by NLR

This topic is 2295 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.