AnsweredAssumed Answered

Scripting Extend Found Set

Question asked by shkovacs on Apr 17, 2010
Latest reply on Jul 26, 2011 by aikiko

Title

Scripting Extend Found Set

Post

Hopefully my explanation below makes sense, and I've included the relevant variables. Having read other theads, that's a "hope", not an expecation! 

 

I have a master table with event id's, and the dates those events took place. An event that takes place on two different dates is represented by two different records. I specifically want replication in that way for other purposes.  The table has approx a million records, with about 54,000 different event id's taking place over 1300 dates. 

 

Each record is pretty long, lots of fields, but a shortened example of the master table might be

 

id 1234      2/10/2006

id 1234      6/15/2007

id 3456     2/10/2006

id 3456      8/9/2008

id  6789    3/15/2008

 

I've made a script that prompts the user to enter a date, then executes a find for all events (id's) that took place on that date. Per the above if you entered 2/10/2006, the found set would be

 

id 1234  2/10/2006

id  3456  2/10/2006

 

 For clarity (?) the same event id can only happen once on a given date. A found set generally ends up having about 200 records in  the initial find (by date). Ie, of the 54,000 possible event ids that could take place on any date, only about 200 actually take place on a specific date. 

 

From within the found set (let's say 200 records with unique event id's), I can right click on an individual Event ID, choose extend found set. All the occurences for that rule id (all the records for all dates for that rule id) are added to the found set. If I right clicked on rule id 1234 and choose extend found set, my found set would change to

 

id 1234  2/10/2006

id 1234  6/15/2007

id 3456  2/10/2006

 

Then ((manually) i'd right click/extend on 3456 and my found set would expand to

 

id 1234  2/10/2006

id 1234  6/15/2007

id 3456  2/10/2006

id 3456      8/9/2008

 

Every event id on the original by date found set will have multiple occurrences as I work through the right click/extend.

 

In effect what I'm doing is using the initial find by date to find the event id's I want to focus on. Then rebuilding the full set of occurrences for those particular event id's. 

 

The manual extend found set action, using the right click on a particular event id, accomplishes what I'm looking for, but it's manual, one id at a time. Doing that 200 times is pretty tedious. And, ultimately, I will be creating multiple found sets (looking at multiple dates) so I'll have many 200 items sets to work through. 

 

Once I get an expanded found set in place, I'll want to save that set. Then work within that extended set (another process, not going to try to get into that now!)  On average, and extended found set will end up being about 1500 records. 

 

How do I script to execute that id by id "extend found set" process?  I'm assuming I'll be able to figure out how to script a save found set once I've finished extended it. 

 

As an aside, I'm finding it a real challenge to translate between script examples from previous versions of Filemaker, into the script creation process in Filemaker 11. The examples I find in Filemaker Help, and often even in the forum, don't really describe the steps you'd take to accomplish the end results with the filemaker 11 gui? That's particularly frustrating when you're pulling up Filemaker 11 help. You'd hope Filemaker would have translated all their examples to match the new gui? (obviously forum examples are a different matter)  I end up with a lot of dents on my forehead from beating my head on the keyboard!

 

 

Outcomes