Thank you for visiting the FileMaker Calculations Explored blog. I recently moved this content over from my blogger account. Hope you like it! When you get a chance, check out the centralized search feature for all the FileMaker blogs found along the right side panel. It is quite handy!

Saturday
Oct112008

FILEMAKER: Nested If Statements Vs Case Statements

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

QUESTION: What is the difference between the Case statement and the If functions. Are they the same thing?

ANSWER: They are similar in the fact that you can create what if type of branching using each. The main difference is that, the Case statement is much easier to write if you have a large amount of variables to test.

With If statements, you have one condition and two possible outcomes. You can nest if statement (in other words one of the outcomes can be an if statement with 1 conditional and two more possible outcomes). I couple years ago, someone wrote a checkbook package. The number conversion to text was supposed to be up to 250 nested if statements.

Case statements on the other hand are

(one condition, one outcome),
(next condition, next, outcome),
(next condition, next, outcome),
(next condition, next, outcome),
if no conditions match outcome.

When you want to add another condition/outcome, you simply type it in. You don't have to worry about the 2 outcome possibilities of an if statement. When you have many condition/outcome operations to write, Case statements are much easier to write than nesting multiple "conditions - outcome1-outcome" if statements.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Saturday
Oct112008

FILEMAKER: Function Fact: How Does The Case Function Evaluate A True Statement?

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

Does it take them from the top down or in reverse? The answer is top down. FileMaker will evaluate each test of the Case function from the top going down and the first TRUE condition will be the final result. This is something to remember when building your CASE function. If you have them in the wrong order, you might get a result you didn’t expect.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Saturday
Oct112008

FILEMAKER: Test Calculations On Smaller Sets Of Data

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

Say you are about to make a calculation change in a large table that you are not confident about. The change may take a long time to do and later undo in databases with large sets of records.

To test on one record, create a field and use the Script step of SET FIELD. This will set the field to the calculated value. If it works, go ahead and use it on a large set of records.

To test on a found set, create a field and use the Script step of Replace or use the associated menu command. This will replace the fields to the calculated value. If it works, go ahead and use it on a large set of records.

Be sure to delete this extra field at some time as a normal cleanup operation.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Friday
Oct102008

FILEMAKER: Copy Calculations To Text Files / Data Viewer

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

Sometimes, you cannot get a calculation just right. When you replace the calculation, the previous version is lost forever. Remember, you can always copy a calculation and paste it into a text file. This can be later used as a reference or if you need to email someone for help.

Another thing that you can do with FileMaker Advanced is to copy the calculation to the Watch tab of the Data Viewer. You can put the calculation right into the area where you want to monitor watched values. You can tweak the calculation, click the button to monitor the results, tweak it again, monitor and repeat until the calculation works just right!

Here you can see an expression being evaluated in the Data Viewer.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

====================== ADVERTISEMENT ==============================
Click Here To See The FileMaker Book (via a blog) homepage!
===================================================================

Tuesday
Oct072008

FILEMAKER: Hiding A Layout Area With A Calculated Container

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

I’ve never used this technique but it was something you would come across “back in the day”, with FileMaker 6 and earlier databases.

There is a technique where you can have a calculated container field hide information on a FileMaker layout. It is not as effective if you are using it on a large layout area but is very effective in hiding a key button or field. If you are going to hide a large area, I would recommend building two layouts. However, two or more layouts can become a pain to a developer. If you make a change in one layout, you need to remember to make the change in the other layouts. After a while, you might loose track of what is where. Some script steps require a particular field to be on the current layout to operate.

More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2010 - Dwayne Wright - dwaynewright.com

Page 1 ... 4 5 6 7 8 ... 67 Next 5 Entries »