Can If handle range of numbers

35 messages Options
Embed this post
Permalink
1 2
Chris Botticella

Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
I have a simple database that invoices clients.  Midway through last year I
was forced to add a handling charge, say of 1% of the cost.  This year I
need to bump it up to 2.5%.

Last year I used an if statement to solve my problem.

If(OrderNum>500, Price*1/100,"")

I now have my early customers (<500) that show no handling charge and
customers that show a handling charge (>500).

I would like to say if OrderNum is between 500 and 800 price is marked up by
1% and if greater than 800 price is marked up by 2.5% or else it is O. This
way first 500 show no charge,
501to 800 would show 1% and 801 and up would be 2.5%.

Can this be done using an if statement?  I know I could create another
handling charge field and place it on top of the present one and use an if
statement to populate it saying if >800 use 2.5% and if not 0....but I
thought maybe someone has already thought about it and solved the problem.

Thanks in advance
Chris

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
VanBuskirk, Patricia

RE: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
I think you should use Case instead of IF.

Case (
OrderNum>500 and OrderNum<800; Price*.01;
OrderNum>800; Price*.025;
"")

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Chris
Botticella
Sent: Thursday, July 03, 2008 12:34 PM
To: Filemaker Experts
Subject: Can If handle range of numbers

I have a simple database that invoices clients.  Midway through last
year I
was forced to add a handling charge, say of 1% of the cost.  This year I

need to bump it up to 2.5%.

Last year I used an if statement to solve my problem.

If(OrderNum>500, Price*1/100,"")

I now have my early customers (<500) that show no handling charge and
customers that show a handling charge (>500).

I would like to say if OrderNum is between 500 and 800 price is marked
up by
1% and if greater than 800 price is marked up by 2.5% or else it is O.
This
way first 500 show no charge,
501to 800 would show 1% and 801 and up would be 2.5%.

Can this be done using an if statement?  I know I could create another
handling charge field and place it on top of the present one and use an
if
statement to populate it saying if >800 use 2.5% and if not 0....but I
thought maybe someone has already thought about it and solved the
problem.

Thanks in advance
Chris

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by Chris Botticella
Chris

> I have a simple database that invoices clients.  Midway through last  
> year I was forced to add a handling charge, say of 1% of the cost.  
> This year I need to bump it up to 2.5%.
>
> Last year I used an if statement to solve my problem.
>
> If(OrderNum>500, Price*1/100,"")
>
> I now have my early customers (<500) that show no handling charge  
> and customers that show a handling charge (>500).
>
> I would like to say if OrderNum is between 500 and 800 price is  
> marked up by 1% and if greater than 800 price is marked up by 2.5%  
> or else it is O. This way first 500 show no charge,
> 501to 800 would show 1% and 801 and up would be 2.5%.
>
> Can this be done using an if statement?  I know I could create  
> another handling charge field and place it on top of the present one  
> and use an if statement to populate it saying if >800 use 2.5% and  
> if not 0....but I thought maybe someone has already thought about it  
> and solved the problem.

Perhaps you could use a Case:

Case (
OrderNum > 800 ; Price * 2.5 / 100 ;
OrderNum > 500 and OrderNum < 800 ; Price * 1 / 100 ;
""
)

Don't forget to allow for order numbers of exactly 500 and 800.

Colm

--
Colm Osiris
Full Moon Information Management
[hidden email]
+44 (0)1422 844050
07837 228 759

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Chris Botticella

Re: [Bulk] Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
Thanks Colm!  Your example helped me to see the proper syntax and the if
statement now works and so does your case.  I forgot to put the field name
in front of the <800.

Greatly appreciate the time you took to help me out!


Chris



----- Original Message -----
From: "Colm Osiris" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, July 03, 2008 12:47 PM
Subject: [Bulk] Re: Can If handle range of numbers


> Chris
>
>> I have a simple database that invoices clients.  Midway through last
>> year I was forced to add a handling charge, say of 1% of the cost.   This
>> year I need to bump it up to 2.5%.
>>
>> Last year I used an if statement to solve my problem.
>>
>> If(OrderNum>500, Price*1/100,"")
>>
>> I now have my early customers (<500) that show no handling charge  and
>> customers that show a handling charge (>500).
>>
>> I would like to say if OrderNum is between 500 and 800 price is  marked
>> up by 1% and if greater than 800 price is marked up by 2.5%  or else it
>> is O. This way first 500 show no charge,
>> 501to 800 would show 1% and 801 and up would be 2.5%.
>>
>> Can this be done using an if statement?  I know I could create  another
>> handling charge field and place it on top of the present one  and use an
>> if statement to populate it saying if >800 use 2.5% and  if not 0....but
>> I thought maybe someone has already thought about it  and solved the
>> problem.
>
> Perhaps you could use a Case:
>
> Case (
> OrderNum > 800 ; Price * 2.5 / 100 ;
> OrderNum > 500 and OrderNum < 800 ; Price * 1 / 100 ;
> ""
> )
>
> Don't forget to allow for order numbers of exactly 500 and 800.
>
> Colm
>
> --
> Colm Osiris
> Full Moon Information Management
> [hidden email]
> +44 (0)1422 844050
> 07837 228 759
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au 

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Beverly Voth-2

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by Colm Osiris-3
OOPs, Colm. What about OrderNum = 800?


Case (
OrderNum > 800 ; Price * 2.5 / 100 ;
OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
""
)

Beverly

On 7/3/08 12:47 PM, "Colm Osiris" <[hidden email]> wrote in whole or in part:

> Chris
>
>> I have a simple database that invoices clients.  Midway through last
>> year I was forced to add a handling charge, say of 1% of the cost.
>> This year I need to bump it up to 2.5%.
>>
>> Last year I used an if statement to solve my problem.
>>
>> If(OrderNum>500, Price*1/100,"")
>>
>> I now have my early customers (<500) that show no handling charge
>> and customers that show a handling charge (>500).
>>
>> I would like to say if OrderNum is between 500 and 800 price is
>> marked up by 1% and if greater than 800 price is marked up by 2.5%
>> or else it is O. This way first 500 show no charge,
>> 501to 800 would show 1% and 801 and up would be 2.5%.
>>
>> Can this be done using an if statement?  I know I could create
>> another handling charge field and place it on top of the present one
>> and use an if statement to populate it saying if >800 use 2.5% and
>> if not 0....but I thought maybe someone has already thought about it
>> and solved the problem.
>
> Perhaps you could use a Case:
>
> Case (
> OrderNum > 800 ; Price * 2.5 / 100 ;
> OrderNum > 500 and OrderNum < 800 ; Price * 1 / 100 ;
> ""
> )
>
> Don't forget to allow for order numbers of exactly 500 and 800.
>
> Colm
>
> --
> Colm Osiris
> Full Moon Information Management
> [hidden email]
> +44 (0)1422 844050
> 07837 228 759
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
John Kornhaus

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
Why include the second half of the second test at all?


Case(
   OrderNum > 800; Price * .025;
   OrderNum > 500; Price * .01;
   0
)

Remember that "The Case function evaluates each test expression in  
order, and when a True expression is found, returns the value  
specified in result for that expression."

The first test will catch any values greater than 800, so the second  
test only has to catch the values greater than 500 since only values  
less than or equal to 800 were left over from the first test.

As a personal preference, I also consider it good practice to return a  
default value appropriate to the type being returned by the other  
result expressions. In this case, the result should be numeric, so I  
have chosen to return a zero rather than an empty text string.

John



On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:

> OOPs, Colm. What about OrderNum = 800?
>
>
> Case (
> OrderNum > 800 ; Price * 2.5 / 100 ;
> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
> ""
> )
>
> Beverly

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Darren Terry-3

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by Beverly Voth-2

On Jul 3, 2008, at 10:38 AM, Beverly Voth wrote:

> Case (
> OrderNum > 800 ; Price * 2.5 / 100 ;
> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
> ""
> )

You don't need the complex second conditional there, because it's not  
possible for OrderNum to be both greater than 800 and less than or  
equal to 800 at the same time.  Just do this:

Case (
OrderNum > 800 ; Price * .025 ;
OrderNum > 500 ; Price * .01 ;
""  //or put 0 here
)

regards,
Darren

******************************
  Darren Terry                               [hidden email]
  Pacific Data Management, Inc.              http://www.pdm-inc.com/
  111 W. St. John St.                      Phone: (408) 283-5900 x303
  Suite 404                                  Fax:   (408) 283-5903
  San Jose, CA 95113
***** FileMaker 9 Certified Developer *****



_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by Beverly Voth-2
Hi Beverly

> OOPs, Colm. What about OrderNum = 800?

I know, I did point out that the 500 and 800 needed handling  
separately. I just didn't put in the '<=' because I didn't know where  
the exact break points were, or whether they should have been '>=' or  
'<='. It could have been

1 to 500; 501 to 800; 801+
or
1 to 499; 500 to 799; 800+
and a few other possibilities.

Colm

--
Colm Osiris
Full Moon Information Management
[hidden email]
+44 (0)1422 844050
07837 228 759

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Colm Osiris-3

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by John Kornhaus
John

> Why include the second half of the second test at all?
>
>
> Case(
>  OrderNum > 800; Price * .025;
>  OrderNum > 500; Price * .01;
>  0
> )

Of course, yes, I should've optimised it! And re. the zero, yes, I  
would do that too.

Colm

--
Colm Osiris
Full Moon Information Management
[hidden email]
+44 (0)1422 844050
07837 228 759
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Beverly Voth-2

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by John Kornhaus
Right, that's my preferred method, too. If the first test..., skip the rest.

But I'll often use the long method to start, to make sure I haven't
forgotten a value (like the "800"). Then I optimize the calc.

Beverly

On 7/3/08 1:58 PM, "John Kornhaus" <[hidden email]> wrote in whole or in
part:

> Why include the second half of the second test at all?
>
>
> Case(
>    OrderNum > 800; Price * .025;
>    OrderNum > 500; Price * .01;
>    0
> )
>
> Remember that "The Case function evaluates each test expression in
> order, and when a True expression is found, returns the value
> specified in result for that expression."
>
> The first test will catch any values greater than 800, so the second
> test only has to catch the values greater than 500 since only values
> less than or equal to 800 were left over from the first test.
>
> As a personal preference, I also consider it good practice to return a
> default value appropriate to the type being returned by the other
> result expressions. In this case, the result should be numeric, so I
> have chosen to return a zero rather than an empty text string.
>
> John
>
>
>
> On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:
>
>> OOPs, Colm. What about OrderNum = 800?
>>
>>
>> Case (
>> OrderNum > 800 ; Price * 2.5 / 100 ;
>> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
>> ""
>> )
>>
>> Beverly
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Bart Bartholomay

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by John Kornhaus
John's right, and the entire expression is evaluated whereafter FMP  
selects the first test that's evaluated as meeting all the criteria.

Bart

On Jul 3, 2008, at 1:58 PM, John Kornhaus wrote:

> Why include the second half of the second test at all?
>
>
> Case(
>  OrderNum > 800; Price * .025;
>  OrderNum > 500; Price * .01;
>  0
> )
>
> Remember that "The Case function evaluates each test expression in  
> order, and when a True expression is found, returns the value  
> specified in result for that expression."
>
> The first test will catch any values greater than 800, so the second  
> test only has to catch the values greater than 500 since only values  
> less than or equal to 800 were left over from the first test.
>
> As a personal preference, I also consider it good practice to return  
> a default value appropriate to the type being returned by the other  
> result expressions. In this case, the result should be numeric, so I  
> have chosen to return a zero rather than an empty text string.
>
> John
>
>
>
> On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:
>
>> OOPs, Colm. What about OrderNum = 800?
>>
>>
>> Case (
>> OrderNum > 800 ; Price * 2.5 / 100 ;
>> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
>> ""
>> )
>>
>> Beverly
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
JimG_EasternMA

lookup question (newbie)

Reply Threaded More More options
Print post
Permalink
I have file where the Salutation field is "Mr." or "Ms." based on
whether the person's given name (contained in field Firstname) is
customarily a male or female name (if it could be either, I enter "Mr./Ms.")

I've filled a number of the Salutation fields by hand (from a
Drop-Down list), but now I'd like have to a calculation for the
Salutation field which would "learn from experience."

For example, if the current record's Firstname was "Henry" it'd look
for another record in the current file where the Firstname was
"Henry", and if it found one, it would take the Salutation from that
record (presumably "Mr."), and fill the Salutation field for the
current record with "Mr." as well. The data is originally imported
from another source (but without salutations.)

I imagine it'd work as follows:

- search for a record in the current file where the Firstname matches
the Firstname in the current record and where the Salutation field is nonblank.
- if such a record is found, take the contents of the Salutation field from it

My question is, how would one script such a calculation? It doesn't
seem like it'd be hard, but I'm still getting used to how FM thinks.

Thanks in advance for any help.

Jim Guinness
East Central MA, USA

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
bfr00

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
In reply to this post by Bart Bartholomay
I don't think so.

I think they've made it very clear that the expression "short circuits" and
the entire expression is NOT evaluated.

This has come up for instance in discussions of performance. If the second
term of the expression were for example a sum across a million records, but
the first expression is very simple and evaluates as true, then the calc
result will be instant and the sum will not occur at all.

> John's right, and the entire expression is evaluated whereafter FMP
> selects the first test that's evaluated as meeting all the criteria.
>
> Bart
>
> On Jul 3, 2008, at 1:58 PM, John Kornhaus wrote:
>
>> Why include the second half of the second test at all?
>>
>>
>> Case(
>>  OrderNum > 800; Price * .025;
>>  OrderNum > 500; Price * .01;
>>  0
>> )
>>
>> Remember that "The Case function evaluates each test expression in
>> order, and when a True expression is found, returns the value
>> specified in result for that expression."
>>
>> The first test will catch any values greater than 800, so the second
>> test only has to catch the values greater than 500 since only values
>> less than or equal to 800 were left over from the first test.
>>
>> As a personal preference, I also consider it good practice to return
>> a default value appropriate to the type being returned by the other
>> result expressions. In this case, the result should be numeric, so I
>> have chosen to return a zero rather than an empty text string.
>>
>> John
>>
>>
>>
>> On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:
>>
>>> OOPs, Colm. What about OrderNum = 800?
>>>
>>>
>>> Case (
>>> OrderNum > 800 ; Price * 2.5 / 100 ;
>>> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
>>> ""
>>> )
>>>
>>> Beverly

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Bart Bartholomay

Re: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
If this is true, I wasn't aware of it. It certainly didn't used to be  
true.

Bart

On Jul 3, 2008, at 9:30 PM, Bruce Robertson wrote:

> I don't think so.
>
> I think they've made it very clear that the expression "short  
> circuits" and
> the entire expression is NOT evaluated.
>
> This has come up for instance in discussions of performance. If the  
> second
> term of the expression were for example a sum across a million  
> records, but
> the first expression is very simple and evaluates as true, then the  
> calc
> result will be instant and the sum will not occur at all.
>
>> John's right, and the entire expression is evaluated whereafter FMP
>> selects the first test that's evaluated as meeting all the criteria.
>>
>> Bart
>>
>> On Jul 3, 2008, at 1:58 PM, John Kornhaus wrote:
>>
>>> Why include the second half of the second test at all?
>>>
>>>
>>> Case(
>>> OrderNum > 800; Price * .025;
>>> OrderNum > 500; Price * .01;
>>> 0
>>> )
>>>
>>> Remember that "The Case function evaluates each test expression in
>>> order, and when a True expression is found, returns the value
>>> specified in result for that expression."
>>>
>>> The first test will catch any values greater than 800, so the second
>>> test only has to catch the values greater than 500 since only values
>>> less than or equal to 800 were left over from the first test.
>>>
>>> As a personal preference, I also consider it good practice to return
>>> a default value appropriate to the type being returned by the other
>>> result expressions. In this case, the result should be numeric, so I
>>> have chosen to return a zero rather than an empty text string.
>>>
>>> John
>>>
>>>
>>>
>>> On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:
>>>
>>>> OOPs, Colm. What about OrderNum = 800?
>>>>
>>>>
>>>> Case (
>>>> OrderNum > 800 ; Price * 2.5 / 100 ;
>>>> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
>>>> ""
>>>> )
>>>>
>>>> Beverly
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
John Weinshel

RE: Can If handle range of numbers

Reply Threaded More More options
Print post
Permalink
The old way, 'reverse polish notation', was abandoned along with the file
format change to .fp7. In rpn, it is true that evaluation continued even
after a true expression was found, but that is no longer the case.


John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Member, FileMaker Business Alliance
Certified For FileMaker 8
Certified For FileMaker 7

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Bart
Bartholomay
Sent: Thursday, July 03, 2008 7:01 PM
To: [hidden email]
Subject: Re: Can If handle range of numbers

If this is true, I wasn't aware of it. It certainly didn't used to be  
true.

Bart

On Jul 3, 2008, at 9:30 PM, Bruce Robertson wrote:

> I don't think so.
>
> I think they've made it very clear that the expression "short  
> circuits" and
> the entire expression is NOT evaluated.
>
> This has come up for instance in discussions of performance. If the  
> second
> term of the expression were for example a sum across a million  
> records, but
> the first expression is very simple and evaluates as true, then the  
> calc
> result will be instant and the sum will not occur at all.
>
>> John's right, and the entire expression is evaluated whereafter FMP
>> selects the first test that's evaluated as meeting all the criteria.
>>
>> Bart
>>
>> On Jul 3, 2008, at 1:58 PM, John Kornhaus wrote:
>>
>>> Why include the second half of the second test at all?
>>>
>>>
>>> Case(
>>> OrderNum > 800; Price * .025;
>>> OrderNum > 500; Price * .01;
>>> 0
>>> )
>>>
>>> Remember that "The Case function evaluates each test expression in
>>> order, and when a True expression is found, returns the value
>>> specified in result for that expression."
>>>
>>> The first test will catch any values greater than 800, so the second
>>> test only has to catch the values greater than 500 since only values
>>> less than or equal to 800 were left over from the first test.
>>>
>>> As a personal preference, I also consider it good practice to return
>>> a default value appropriate to the type being returned by the other
>>> result expressions. In this case, the result should be numeric, so I
>>> have chosen to return a zero rather than an empty text string.
>>>
>>> John
>>>
>>>
>>>
>>> On Jul 3, 2008, at 12:38 PM, Beverly Voth wrote:
>>>
>>>> OOPs, Colm. What about OrderNum = 800?
>>>>
>>>>
>>>> Case (
>>>> OrderNum > 800 ; Price * 2.5 / 100 ;
>>>> OrderNum > 500 and OrderNum <= 800 ; Price * 1 / 100 ;
>>>> ""
>>>> )
>>>>
>>>> Beverly
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
JimG_EasternMA

OOPS -- Re: lookup question (newbie) -- new topic re: mail merge strategy

Reply Threaded More More options
Print post
Permalink
In reply to this post by JimG_EasternMA
Sorry, I was a bit premature in posting my last inquiry about lookups
-- FM made that task pretty easy.

I now have another question. I import data from a source in which
each record includes either one or two names along with some header
information. After researching and entering the addresses that go
with each of the (one or two) names, I need to perform a mail merge
on the names, i.e. send a letter to either one or two names per
record. I need to preserve the structure of the data as imported,
i.e. keep the one or two names together with the record's header
info. The merge data includes some of the header info along with the
names and addresses.

My question is, what's the simplest way to do this? It'll have to be
done once a week, about 100 names per week, by me and my partner
until we can get someone else to do it. In addition, one subset of
the names will probably have a different kind of address label
printed than the rest.

Alternatives I'm considering include:

a. Doing two passes through the file: the first for all records, to
grab the name in the first slot, the second only for records which
have a name in the second slot.

b. Creating a temporary spinoff file which will have one record per
name, and creating the merge file from it. I don't know how to create
such a spinoff file in FM.

Any thought or ideas appreciated; thanks in advance.

Jim Guinness
East Central Massachusetts, USA  
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Brett Duncan

Re: OOPS -- Re: lookup question (newbie) -- new topic re: mail merge strategy

Reply Threaded More More options
Print post
Permalink
Jim Guinness wrote:

> Sorry, I was a bit premature in posting my last inquiry about lookups --
> FM made that task pretty easy.
>
> I now have another question. I import data from a source in which each
> record includes either one or two names along with some header
> information. After researching and entering the addresses that go with
> each of the (one or two) names, I need to perform a mail merge on the
> names, i.e. send a letter to either one or two names per record. I need
> to preserve the structure of the data as imported, i.e. keep the one or
> two names together with the record's header info. The merge data
> includes some of the header info along with the names and addresses.
>
> My question is, what's the simplest way to do this? It'll have to be
> done once a week, about 100 names per week, by me and my partner until
> we can get someone else to do it. In addition, one subset of the names
> will probably have a different kind of address label printed than the rest.
>
> Alternatives I'm considering include:
>
> a. Doing two passes through the file: the first for all records, to grab
> the name in the first slot, the second only for records which have a
> name in the second slot.
>
> b. Creating a temporary spinoff file which will have one record per
> name, and creating the merge file from it. I don't know how to create
> such a spinoff file in FM.
>
> Any thought or ideas appreciated; thanks in advance.

Why not simply create a calculation field that combines the two name
fields if there's something in the second field,

e.g. name1 & If(IsEmpty(name2; ""; " & " & name2)

HTH

Brett
--
Brett Duncan
IT Coordinator
Wycliffe Christian School
Warrimoo NSW 2774
Australia

P +61 4753 6422
F +61 4753 6082
E [hidden email]
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
JimG_EasternMA

Re: OOPS -- Re: lookup question (newbie) -- new topic re: mail merge strategy

Reply Threaded More More options
Print post
Permalink
At 7/4/2008 12:37 AM, you wrote:
Why not simply create a calculation field that combines the two name
fields if there's something in the second field,

>e.g. name1 & If(IsEmpty(name2; ""; " & " & name2)
>
>HTH
>
>Brett
>--

Sorry, I didn't explain very well. Each name has its own address,
city, state, etc., so each has to have a separate letter sent to it.

Jim

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Tom Elliott

Re: OOPS -- Re: lookup question (newbie) -- new topic re: mail merge strategy

Reply Threaded More More options
Print post
Permalink
In reply to this post by JimG_EasternMA
Jim

Why two passes? You can do it all in one. Pseudo_script:

Enter Browse Mode
Go to record [First]
Loop
   set variable $c = 1
   loop
     ...
     do your mailing here using name1 if $c = 1 else name2
     ...
     exit loop if [ $c >1 or isempty ( name 2 ) ]
     set variable $c = 2
   end loop
   go to  record [next; exit after last]
end loop

cheers

Tom

On 4 Jul 2008, at 5:17, Jim Guinness wrote:

> Sorry, I was a bit premature in posting my last inquiry about  
> lookups -- FM made that task pretty easy.
>
> I now have another question. I import data from a source in which  
> each record includes either one or two names along with some header  
> information. After researching and entering the addresses that go  
> with each of the (one or two) names, I need to perform a mail merge  
> on the names, i.e. send a letter to either one or two names per  
> record. I need to preserve the structure of the data as imported,  
> i.e. keep the one or two names together with the record's header  
> info. The merge data includes some of the header info along with the  
> names and addresses.
>
> My question is, what's the simplest way to do this? It'll have to be  
> done once a week, about 100 names per week, by me and my partner  
> until we can get someone else to do it. In addition, one subset of  
> the names will probably have a different kind of address label  
> printed than the rest.
>
> Alternatives I'm considering include:
>
> a. Doing two passes through the file: the first for all records, to  
> grab the name in the first slot, the second only for records which  
> have a name in the second slot.
>
> b. Creating a temporary spinoff file which will have one record per  
> name, and creating the merge file from it. I don't know how to  
> create such a spinoff file in FM.
>
> Any thought or ideas appreciated; thanks in advance.
>
> Jim Guinness
> East Central Massachusetts, USA  
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Darren Terry-3

Re: lookup question (newbie)

Reply Threaded More More options
Print post
Permalink
In reply to this post by JimG_EasternMA

On Jul 3, 2008, at 6:25 PM, Jim Guinness wrote:

> I imagine it'd work as follows:
>
> - search for a record in the current file where the Firstname  
> matches the Firstname in the current record and where the  
> Salutation field is nonblank.
> - if such a record is found, take the contents of the Salutation  
> field from it
>
> My question is, how would one script such a calculation? It doesn't  
> seem like it'd be hard, but I'm still getting used to how FM thinks.

Hi Jim:

First of all, you wouldn't want a calculation field because you want  
to override it when it's wrong.

I would define a self-join relationship where the table is related to  
itself by firstname.  Then, define the salutation field as an auto-
entered lookup from the selfjoin, looking up from selfjoin::salutation.

Hopefully that makes sense.

regards,
Darren

******************************
  Darren Terry                               [hidden email]
  Pacific Data Management, Inc.              http://www.pdm-inc.com/
  111 W. St. John St.                      Phone: (408) 283-5900 x303
  Suite 404                                  Fax:   (408) 283-5903
  San Jose, CA 95113
***** FileMaker 9 Certified Developer *****



_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
1 2