In
If (test;result1;result2)
is result2 if the test is false? and result 1 is if the test is true?
|
|
0
|
|
|
|
Reply
|
Jennifer_Beecroft (79)
|
5/16/2012 7:17:30 AM |
|
On Wed, 16 May 2012 00:17:30 -0700 (PDT), JayBee wrote:
> If (test;result1;result2)
>
> is result2 if the test is false? and result 1 is if the test is true?
Wouldn't it be faster to just try it?
Yes, your assumption is correct - especially due to the syntax variation
if (test; result1)
This is equal to
if (test; result1; "")
Later pro versions would permit custom functions:
my()
GetField( Get ( ActiveFieldName ) ))
myif(test; result1)
if(test, result1,
my))
.... which would keep the current value if the if condition does not
match.
That's most helpful for a replace operation,
although this replace operation is very dangerous within FMP, since
there's no advanced undo mechanism.
- Martin
|
|
0
|
|
|
|
Reply
|
t-usenet (136)
|
5/16/2012 8:57:01 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
:-)
|
|
0
|
|
|
|
Reply
|
Jennifer_Beecroft (79)
|
5/16/2012 11:11:48 AM
|
|
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
|
|
0
|
|
|
|
Reply
|
Jennifer_Beecroft (79)
|
5/21/2012 6:18:49 PM
|
|
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
|
|
0
|
|
|
|
Reply
|
t-usenet (136)
|
5/21/2012 6:27:54 PM
|
|
"Martin?rautmann" <t-usenet@gmx.net> schreef in bericht
news:slrnjrl29a.2v8.t-usenet@ID-685.user.individual.de...
> 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
|
|
0
|
|
|
|
Reply
|
Ursus.kirk8751 (6)
|
5/21/2012 8:39:43 PM
|
|
In article
<36681ad8-c916-46d1-b352-e6f7207ff850@b26g2000vbt.googlegroups.com>,
JayBee <Jennifer_Beecroft@hotmail.com> 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!
>
> 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 :o)
|
|
0
|
|
|
|
Reply
|
HelpfulHarry2 (409)
|
5/21/2012 9:05:03 PM
|
|
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
|
|
0
|
|
|
|
Reply
|
Jennifer_Beecroft (79)
|
6/10/2012 9:53:34 AM
|
|
|
7 Replies
93 Views
(page loaded in 0.327 seconds)
Similiar Articles: quick problem - parsing text, calculation function... - comp ...Your original question actually came immediately after an almost ... get line breaks into email message body - comp.lang ... quick problem - parsing text, calculation function ... Re: fast angle calculation between 2D vectors - comp.soft-sys ...This function calculates angels between to groups of ... 180/pi; > > =A0 =A0 end > > Do you have a question? ... update in real-time allowing quick calculation/conversion ... Checkbox calculation - comp.databases.filemakerI have a quick question. I have a FM8 ... Your statement that you duplicated ... Checkbox calculation - comp.databases.filemaker Hi. I have a quick question. Age range calculation problem - comp.databases.filemaker ...... group has an age > 15, therefore the If statement is ... look into using the Case() or Choose() functions for ... Duplicate vs. Original, Calculation question - comp.databases ... How to declare variable - comp.soft-sys.sasHi, 2 quick questions. 1. How to ... 1) use the ATTRIB statement or a combination of LENGTH, FORMAT, INFORMAT and LABEL statements. Very fast delimited record parsing with boost - comp.lang.c++ ...Did you cross-post your question on one of ... and the parser (even for complex syntax ... with boost - comp.lang.c++ ... quick problem - parsing text, calculation function ... HP48G+ memory question - comp.sys.hp48... STACK, LAST CMD and LAST ARG functions ... comp.sys.hp48 HP48G+ memory question - comp.sys.hp48 Syntax of ... Memory Questions HP 48g Graphing Calculator - HP Customer Care ... string temperature conversion - comp.soft-sys.matlabI'm writing a function that converts two ... It is a quick read and it will answer all of your questions. ... As a general statement of program ... Recursive interpolation function - comp.databases.filemaker ...I did do a quick test FileMaker ... The question on this function definition is: is there a ... your function outside custom function and move it inside a normal calculation ... RPN question - comp.sys.hp48For a quick explanation see http://www ... RPN question - comp.sys.hp48 As a former algebraic calculator user, I was exposed to ... 3 ... how do I erase individual plot functions ... Excel Function Syntax - Excel IF Function Syntax - Excel Function ...Spreadsheet definition - Syntax. This glossary entry defines ... Excel IF Function - How to Create an IF Function in Excel - Parts of the IF... Answers to Quick Calculator Questions - The United States Social ...Social Security Quick Calculator: Answers to Quick Calculator Questions ... Does the Quick Calculator assume I will have covered earnings up to the ... 7/13/2012 12:34:06 PM
|