# Help with calculation

This topic is 7474 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

• Newbies

In my database, using FileMaker Pro 5.0, I created four fields, UNIT COST, QUOTE COST, INTERNAL, EXTERNAL.

What I want is if INTERNAL is true, than I need QUOTE COST to calculate the UNIT COST + UNIT COST * .13. If EXTERNAL is true, I need QUOTE COST to calculate the UNIT COST + UNIT COST * .30.

I was able to create a very crude calculation that worked except if I originally have INTERNAL true and then I change my mind and make EXTERNAL true, the QUOTE COST field will not recalculate. How can I get QUOTE COST to either clear or recalculate when I change the values in both INTERNAL and EXTERNAL fields? Am I making sense??

I have a PC and another thing that drives me crazy is when I tab into a field it doesn't select all (like my MAC did) and I have to, for example, use the back or delete key to clear the field or retype. Am I missing a shortcut or option?

Thanks so much for your help!!

##### Share on other sites

I hope that I can help... heres my try:

---------------------------------------------------------

Here's a calculation what would work if INTERNAL and EXTERNAL are numeric.

case (

internal, unit cost + unit cost * .13,

external, unit cost + unit cost * .30

)

or

case (

internal <> 0, unit cost + unit cost * .13,

external <> 0, unit cost + unit cost * .30

)

---------------------------------------------------------

This is the logic of this calculation

If INTERNAL is TRUE (true is anything other than 0) then

unit cost + unit cost * .13,

If INTERNAL is FALSE (fales is 0 or empty) and EXTERNAL is TRUE then,

unit cost + unit cost * .30

That should work, but you need to ensure that only one of these actually satisfy these conditions. In other words, if you make external true, you need to ensure that internal is then made false.

There are other ways that you could do this, but I am trying to answer your question under the conditions that you have stated.

--

Your other question regarding SELECT ALL on entry:

1) enter layout mode

2) right click on 'Field Format...'

3) under the section 'Behavior' make sure that the option 'Select entire contents of field on entry' is selected.

##### Share on other sites

• Newbies

I love you! Seriously, thanks so much. You saved this poor girl hours of work.

And I especially thank you for the select all format info. That has been driving me crazy for months and I could not find anything on it in Help.

Have a wonderful weekend!

##### Share on other sites

• Newbies

If my field UNIT COST and QUOTE COST are repeating, will each line calculate using the above formula?

##### Share on other sites

This topic is 7474 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account