Nov 09, 2009; 17:09
Louis Nuyens
Summing a subset of found records
Hi all,
I can't quite figure this one out at the moment.
-- LEVEL 1 --
Lets say you have a found set of 500 records.
Let's say you want a calculations such that
the 429th (CURRENTRECORD) record to sum values from a given field
(COUNT_ME) for the 321st record (SUMBEGIN) through the 378th record
(SUMEND),
and
the 430th record sums values for COUNTME in the 322nd through 398th
record, and so on.
Let's say you want that behavior to persist regardless of sort order.
How would we do that?
ANOTHER WAY TO PUT THIS IS
I want a calculation such that record X sums the COUNTME field for N
records Y through Z that are a subset of the current found set, and
are consecutive in the current sort order.
-- LEVEL 2 --
Now let's say that if the current record number is such that Y though
Z does not contain N records, we want the calculation result to be
empty.
E.g. Let's say we want record X to sum the previous N=10 records,
(X-10 through X-1) -- when X = 5 there won't be 10 records to sum, so
we want the calculation result to be blank/empty.
-- LEVEL 3 --
(IGNORE THIS -- I think I can do this part -- using a calculation
that yields a 1 or a 0 value every time the COUNTME field is zero or
empty, and then getting a Count of the result.) Now let's say that if
more than X of the records for which the field to be summed are zero,
we want a zero result
--
NOTICE: In accordance with Title 17 U.S.C., section 107, some
material is provided without permission from the copyright owner,
only for purposes of criticism, comment, scholarship and research
under the "fair use" provisions of federal copyright laws. These
materials may not be distributed further, except for "fair use,"
without permission of the copyright owner. For more information go to:
http://www.law.cornell.edu/uscode/17/107.shtml
--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/FileMaker/Browse/
Manage your subscription: http://www.ListSearch.com/FileMaker/
Nov 09, 2009; 17:20
Jonathan Fletcher
Re: Summing a subset of found records
Nov 10, 2009; 00:00
Tom Elliott
Re: Summing a subset of found records
Nov 10, 2009; 00:13
Tom Elliott
Re: Summing a subset of found records
Nov 10, 2009; 09:06
Bruce Robertson
Re: Summing a subset of found records