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

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

Recommended Posts

  • Newbies
Posted

Hello,

I'm very new to Filemaker and am having trouble coming up with a script for locating previous records with entries in an ID field that are similar to the current entry. I have only seen threads about identifying duplicate records or using multiple fields to locate similar records.

Here's the background for my problem. My database contains records of salamander captures, where each salamander is given a unique "code" (or ID) that allows it to be identified when it is re-located in the future (to track growth rates, movement, etc...). Each code is a unique color-position combination and each salamander is generally given up to five colored marks in any of six positions. The colors used are pink, orange, and yellow. Positions are numbered 1 through 6. A list of codes would look like this 5o25y, 12o16y, 1o1y, 1o1y, 12o46y, 12p6y, etc... A 1o12y code can be interpreted as "an orange mark in the first position and a yellow mark in the first and second positions." Pink always comes before orange, which comes before yellow. When an animal is re-captured, the code for the new record adds a letter "R" at the end: 5o25yR, 12o16yR, etc...

The problem is that codes are sometimes mis-read when an animal is re-located. As a first step, I created a button in my layout that performs a script to identify records with the exact same code. The script causes a new window to pop out which lists the current record for an individual as well as all previous records which match that code. This verifies that an animal was correctly identified. The Perform Find command searches for records with a matching code for that location and species (codes are recycled in different areas and for different species).

Freeze Window

If[PatternCount (MRC::Code;"R")=1]

New Window []

View As [View as List]

Set Variable [$Species; Value:MRC::Species]

Set Variable [$HU; Value:MRC::Harvest Unit]

Set Variable [$Code; Value:Left(MRC::Code;(Length(MRC::Code)-1))]

Go to Layout ["Code Check" (MRC)]

Perform Find [Restore]

End If

My question is whether anyone has an idea for how to search all records for codes which have similar character matching. When a salamander is initially mis-identified (no matching records found), it would be helpful to have a list of the records with the closest matching codes. At the moment, I would need to perform a number of permutations of relaxed searches (using the @, #, or * operators) to identify salamanders with similar codes and keep track of possible options.

The most likely case is that a color mark is overlooked or has been lost. A code of 12o3yR which has no previous matching records could be searched for using 12@o3y, 12o@3y, 12o@@3y, 12o@3@y, 12o3@y, 12o3@@y. Occasionally, a mark migrates (changes position) so that 12o3yR could also match previous #2o3y, 1#o3y, or 12o#y records. Having more than one error is probably highly unlikely.

Is there a way to cycle through all of these possible relaxed searches to generate a list or simply find other records with code entries where most of the characters are shared with the code of the current record?

Thanks in advance for any help! I hope I'm not overlooking anything too simple.

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