dbTalk Databases Forums  

Quick Question - If Calculation funtion Syntax

comp.databases.filemaker comp.databases.filemaker


Discuss Quick Question - If Calculation funtion Syntax in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JayBee
 
Posts: n/a

Default Quick Question - If Calculation funtion Syntax - 05-16-2012 , 02:17 AM






In

If (test;result1;result2)

is result2 if the test is false? and result 1 is if the test is true?

Reply With Quote
  #2  
Old   
JayBee
 
Posts: n/a

Default Re: Quick Question - If Calculation funtion Syntax - 05-16-2012 , 06:11 AM






Well thanks for your help Martin - of course I tested it - just a lot
of fields and factors going on. I like to get clarification from the
helpful FM community sometimes.

Kind Regards
Jay
:-)

Reply With Quote
  #3  
Old   
JayBee
 
Posts: n/a

Default Re: Quick Question - If Calculation funtion Syntax - 05-21-2012 , 01:18 PM



The reason why I was asking is because I'm trying to use an If
calculation function in calculation fields where result is text. You
confirmed what I thought was true above, so I don't understand why it
is not working:

My calculation is the following for each respective field: Field1:
If(ABorC1="A";PartsUsed1)

Field2: If(ABorC2="A";PartsUsed2)

Field3: If(If(ABorC3="A";PartsUsed3) etc etc up to field 17

However at the moment even if one of fields with a pop up menu ABorC
is not equal to A but is actually equal to B or C the parts used field
is still the result whereas I'd actually want it to be blank if the
value is B or C and only show the value if it applies to A and A is
true for the relevant ABorC field.

Can anyone think why this is? I'm stumped so far!

Many Thanks
Jay

Reply With Quote
  #4  
Old   
Ursus
 
Posts: n/a

Default Re: Quick Question - If Calculation funtion Syntax - 05-21-2012 , 03:39 PM



"Martin?rautmann" <t-usenet (AT) gmx (DOT) net> schreef in bericht
news:slrnjrl29a.2v8.t-usenet (AT) ID-685 (DOT) user.individual.de...
Quote:
On Mon, 21 May 2012 11:18:49 -0700 (PDT), JayBee wrote:
The reason why I was asking is because I'm trying to use an If
calculation function in calculation fields where result is text. You
confirmed what I thought was true above, so I don't understand why it
is not working:

My calculation is the following for each respective field: Field1:
If(ABorC1="A";PartsUsed1)

Field2: If(ABorC2="A";PartsUsed2)

Field3: If(If(ABorC3="A";PartsUsed3) etc etc up to field 17

However at the moment even if one of fields with a pop up menu ABorC
is not equal to A but is actually equal to B or C the parts used field
is still the result whereas I'd actually want it to be blank if the
value is B or C and only show the value if it applies to A and A is
true for the relevant ABorC field.

Can anyone think why this is? I'm stumped so far!

A) does it rely on fields which may be empty? Did you tick the options
to compute on empty fields?

B) is it a calculation field with result text or an autoenter on a
simple text field? If text field, mark the option to replace field
contents with new results

C) is the one of the fields a related data? This may cause trouble
especially if the source is within another file. Data should be within
the same file, within another table.

D) is the data from a relation? Then calculation may be blocked until
the record is left.

E) is one of the fields for the calculation still active? Calculation
will happen only if the field was left.

Just some ideas...
Martin
Hi Jennifer,

Not quite an answer, but you also might think about restructuring your data.
It seems like are are repeating the same action 17 times for almost the same
information.
And what if within an month or so an other 4 ABorC fields are needed?
Are you then going to make 4 more fields, and 4 more calc fields?
it seems to me that PartsUsed should be a table of its own.
Then the main table should be joined many-to-may to the PartsUsed table.
It is then not only possible to create an occurrence based on ABorC, but the
contents of your fields are directly visible through a portal.
And you can add as many as needed without creating all these fields.

It will need some more work then explained here, I just wanted to make the
point that repetitive work should not be done by the human, but by the
database.

Keep well, Ursus

Reply With Quote
  #5  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Quick Question - If Calculation funtion Syntax - 05-21-2012 , 04:05 PM



In article
<36681ad8-c916-46d1-b352-e6f7207ff850 (AT) b26g2000vbt (DOT) googlegroups.com>,
JayBee <Jennifer_Beecroft (AT) hotmail (DOT) com> wrote:

Quote:
The reason why I was asking is because I'm trying to use an If
calculation function in calculation fields where result is text. You
confirmed what I thought was true above, so I don't understand why it
is not working:

My calculation is the following for each respective field: Field1:
If(ABorC1="A";PartsUsed1)

Field2: If(ABorC2="A";PartsUsed2)

Field3: If(If(ABorC3="A";PartsUsed3) etc etc up to field 17

However at the moment even if one of fields with a pop up menu ABorC
is not equal to A but is actually equal to B or C the parts used field
is still the result whereas I'd actually want it to be blank if the
value is B or C and only show the value if it applies to A and A is
true for the relevant ABorC field.

Can anyone think why this is? I'm stumped so far!

Many Thanks
Jay
Change the If statement to enforece an empty result when the test fails.
e.g.
If (ABorC1="A"; PartsUsed1; "")

Also make sure the Calculation Field is set to NOT be stored and TO
calculate when the source fields are empty.

Helpful Harry )

Reply With Quote
  #6  
Old   
JayBee
 
Posts: n/a

Default Re: Quick Question - If Calculation funtion Syntax - 06-10-2012 , 04:53 AM



Thanks for everybody suggestions. As i was running back through my
work and looking at suggestions - I realised it was blatnatly my
fault. I made a stupid mistake. Copying and pasting the calculation
from one field to another is fine......As long as you remember to
change the important parts in the copied text... :-/. Sorry , a
simple mistake on my part that was easily fixed once I realised what
it was ... BUT a little bit embarassing.

Because I'd only been changing the second field name PartsUsed2,
PartsUsed2 etc in the respective calculation fields, but I'd forgotten
to change the ABorC field names to 2, 3 etc, it was looking in ABorC1
field for all of the results.....

Really sorry about this.

Jay

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.