Loops in Found Sets

Loops in Found Sets

am 01.11.2007 05:44:37 von CRC123

Windows XP - FMP 9 Adv.
Also to be used in Mac OSX at some point.
Skill Level - Moderate

Problem: how to run loops on a Found Set only of a file.
FMP File (call it A) contains records of property sales and their
details. Up to 2000 - 5000 records. Not much data really.
Source data is provided monthly by local gov't authority in CSV)


Steps so far :
Open FMP File A
FMP File A - Find All
Find Omitted - call it FILE A:OMITTED.
Import monthly Source Data
This results in FOUND SET (new data)

No problem at this point with importing the CSV data. Sales are
categorized by "Area" of province. (numeric "nn" from 01 to 27, not
contiguous, 11 areas total, possibly 1000 to 2000 records of which
only 500 to 600 are relevant. I have a working script that eliminates
unwanted Areas and sub areas.
And now I have a "FOUND SET" of this month's data that is isolated
from all previous records in FILE A:OMITTED.

But FOUND SET has to be massaged into usable field formats with trims
and date adjustments, about 4 separate scripts (these trims and date
adjustments have already been performed on on FILE A:OMITTED records.)
No problem with these scripts working as required BUT:

The problem is that these "massaging" scripts run as LOOPS with start
with first and exit after last. This, it seems, brings up the entire
FILE A:OMITTED and not just the FOUND SET and so takes forever to run
as it is going over the entire file instead of just my newly imported
data.

A possible solution would be to have two separate files File A - main
file, and File B - the import file to be tweaked, and then do an
export/import script somehow. I am primarily a Mac-ie and I could do
this with an AppleScript but not sure about PC protocol. Can a 2 file
solution be converted into a Run Time for my other two offices?

Any help as to isolating my FOUND SET will be appreciated. TX

Re: Loops in Found Sets

am 01.11.2007 05:51:22 von CRC123

On Oct 31, 9:44 pm, CRC123 wrote:
> Windows XP - FMP 9 Adv.
> Also to be used in Mac OSX at some point.
> Skill Level - Moderate
>
> Problem: how to run loops on a Found Set only of a file.
> FMP File (call it A) contains records of property sales and their
> details. Up to 2000 - 5000 records. Not much data really.
> Source data is provided monthly by local gov't authority in CSV)
>
> Steps so far :
> Open FMP File A
> FMP File A - Find All
> Find Omitted - call it FILE A:OMITTED.
> Import monthly Source Data
> This results in FOUND SET (new data)
>
> No problem at this point with importing the CSV data. Sales are
> categorized by "Area" of province. (numeric "nn" from 01 to 27, not
> contiguous, 11 areas total, possibly 1000 to 2000 records of which
> only 500 to 600 are relevant. I have a working script that eliminates
> unwanted Areas and sub areas.
> And now I have a "FOUND SET" of this month's data that is isolated
> from all previous records in FILE A:OMITTED.
>
> But FOUND SET has to be massaged into usable field formats with trims
> and date adjustments, about 4 separate scripts (these trims and date
> adjustments have already been performed on on FILE A:OMITTED records.)

OOPS - I meant FILE A

> No problem with these scripts working as required BUT:

> The problem is that these "massaging" scripts run as LOOPS with start
> with first and exit after last. This, it seems, brings up the entire
> FILE A:OMITTED and not just the FOUND SET and so takes forever to run
> as it is going over the entire file instead of just my newly imported
> data.
>
> A possible solution would be to have two separate files File A - main
> file, and File B - the import file to be tweaked, and then do an
> export/import script somehow. I am primarily a Mac-ie and I could do
> this with an AppleScript but not sure about PC protocol. Can a 2 file
> solution be converted into a Run Time for my other two offices?
>
> Any help as to isolating my FOUND SET will be appreciated. TX

Re: Loops in Found Sets

am 01.11.2007 05:59:04 von Lynn Allen

On 2007-10-31 21:44:37 -0700, CRC123 said:

> The problem is that these "massaging" scripts run as LOOPS with start
> with first and exit after last. This, it seems, brings up the entire
> FILE A:OMITTED and not just the FOUND SET and so takes forever to run
> as it is going over the entire file instead of just my newly imported
> data.

This is contrary to my experience. Found sets on import always remain
isolated until a Show All Records command or other Find instruction is
given. Examine your script for such a command. It may be contained in
a subscript, so check those too.

The Go to Record (First) and Exit After Last, or the Loop command will
not mingle the found set with the omitted records.

Be sure that you are not going to another layout which has the same
base table but a different Table Occurance than the table into which
you've just imported the records. Going to a different TO-based layout
will not preserve your found set.

If you wish to take double-sure belt-and-suspenders precautions, as the
first step after import, capture all your imported RecordIDs into a
global field, each on a line separated by returns. Use the List
function to do this.

Create a self-relationship from that global to the RecordID field. Now,
before each loop, perform a Go To Related Records using that global to
record ID relationship and it will re-isolate the set of records you
just imported.

But I suspect you've got a Show All or a TO change to thank for your problems.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

Re: Loops in Found Sets

am 01.11.2007 13:56:34 von VoicesInMyHead

> Any help as to isolating my FOUND SET will be appreciated. TX

My experience is the same a Lynn's - when importing records, they are
left as the 'found set', and the original records are always omitted.
Maybe you've checked for this, but if you are running a 'find'
instruction (as suggested) at any point after your import, it will
find on all records, not just your imported records. Use 'constrain
found set', as an actual 'find' will pull in your omitted records and
mingle them with your import.

It can get ugly, and the original omitted records sometimes feel
rejected as they mingle with the "new" and "wanted" records. Because
of their jealousy, they tend to drink, and generally make a nuisance
of themselves - kegs get emptied, lamp shades get worn, clothes get
strewn about... It's like a bad New Years Eve!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Reality is the leading cause of stress...
....amongst those in touch with it.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
WinXP Pro 32 & 64Bit / FMP Adv 9.0v1
VoicesInMyHead
a.k.a. The Voices
No, we're not... Yes, we are...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The only reason some people get lost in thought
is because it's unfamiliar territory for them.

Re: Loops in Found Sets

am 02.11.2007 16:35:44 von CRC123

On Nov 1, 5:56 am, VoicesInMyHead wrote:
> > Any help as to isolating my FOUND SET will be appreciated. TX
>
> My experience is the same a Lynn's - when importing records, they are
> left as the 'found set', and the original records are always omitted.
> Maybe you've checked for this, but if you are running a 'find'
> instruction (as suggested) at any point after your import, it will
> find on all records, not just your imported records. Use 'constrain
> found set', as an actual 'find' will pull in your omitted records and
> mingle them with your import.
>
> It can get ugly, and the original omitted records sometimes feel
> rejected as they mingle with the "new" and "wanted" records. Because
> of their jealousy, they tend to drink, and generally make a nuisance
> of themselves - kegs get emptied, lamp shades get worn, clothes get
> strewn about... It's like a bad New Years Eve!
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Reality is the leading cause of stress...
> ...amongst those in touch with it.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> WinXP Pro 32 & 64Bit / FMP Adv 9.0v1
> VoicesInMyHead
> a.k.a. The Voices
> No, we're not... Yes, we are...
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> The only reason some people get lost in thought
> is because it's unfamiliar territory for them.

Thank you all - I will closely examine my script steps just as soon as
I clean my sticky keyboard of Heineken stains and remove the Hanes for
Her draped over the monitor.