Associated fields question
Jay R. Ashworth
jra at baylink.com
Tue Mar 28 11:03:38 PST 2006
On Tue, Mar 28, 2006 at 12:07:01PM -0500, Jaime Perry wrote:
> My problem is that I need to select and sort the record for each
> instance where the union code matches the selection criteria. In the
> above example, 4 of the 5 lines would pass (the D10 union codes).
When you're working with a report on an index containing an associated
field as one of it's index elements (I believe I've phrased the
limitations correctly there), the system field @AF serves as a virtual
"array index", telling you *which* instance of the associated field (in
ascending field-number order) was the one which caused the selection of
the record you're in right now.
That is:
[ ... ]
10 a1) location
11 a1) location
12 a1) location
13 a1) location
14 a1) location
[ ... ]
Index A: built on field a1)
If record 5 has fields 10, 11, and 12 populated, it will appear in the
report 3 times. As each record is processed, @AF will equal 1, 2 or 3,
depending on which 'instance' of the record existing in the index is
currently being processed.
That's a fairly difficult concept to explain, living as it does in the
corner of "database-assisted denormalization", but I hope that
explained it.
In your case, you could just map an array against your associated real
fields, use @af to index into it to find out which "copy" of the record
you're working on, and then END. (Or, if the countdown counter's
accuracy is critical to you, you could do it in selection processing, I
guess...)
Cheers,
-- jra
--
Jay R. Ashworth jra at baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on Usenet and in e-mail?
More information about the Filepro-list
mailing list