FileMaker Calculation AnalysisFileMaker Calculations are everywhere, not just in fields and script steps. They are all over your layouts, in your custom menus and even in your security settings. They might just be the heart and soul of your FileMaker system. But they are scattered all over the place, which makes them hard to track. FMPerception has a new feature that can help you find and fix problems related to calculations getting out of hand. It makes FileMaker Calculation Analysis a thing of beauty.

Heart and Soul

Most of the business logic of your FileMaker solution is either encoded in Calculations or passes through calculations in some way. You can use calcs to hide and/or format layout objects. You can use them to filter portals, display dynamic button labels, show tooltips, and populate placeholders. And that’s just layouts.

There are custom function calcs, custom menu calcs, and record level access calcs. There are of course calculations in scripts, and in fields. But hey, did you know that a field can have two calculations at a time, one for the auto-enter and one for validation calculation?

Think about this for a moment. A single field object on a layout can have the following calculations defined in or on it:

  • Field Definition
    • Auto-Enter
    • Validation
  • Layout Object
    • Data Hide
    • Tooltip
    • Placeholder
    • Several Script Trigger Parameters
    • Dozens of Conditional Formatting Functions
    • Button Parameter

That’s a lot of functions!  Calc functions are everywhere and are used for lots of different types of logic.  They are the heart and soul of any FileMaker Custom Application. Since they are so useful, they get copied and pasted around, they get broken, they get used out of context. Sometimes they just get huge and complex, or reference other huge and nested unstored calculations.

FileMaker Calculation Analysis

You have always been able to use FMPerception to help fix some of the problems we outlined above.  But…  It was scattered about.  Since the FMPerception interface mirrors FileMaker’s structure we displayed the calcs embedded in each object.  For example, if you searched for some text that appeared in every one of the calcs on the example field above, you would only get one result. Just the field. That’s it.  Even though FMPerception found each instance of the string it had no way to show you all those results.

Enter the Calculations List view, located in the slow query section of the browser.  The Calculations List view is a single list of every calculation in your custom application. You can also easily narrow the list down to just every calc in a single file, or script, or (my particular favorite) just one layout.  Suddenly we have a much better way to look at and explore our calculations. But our story doesn’t end there.

The Devil is in the Details

Ok great. We have one list of calcs. Very helpful.  But it’s the details we get with the list that makes it super interesting.  There are about 2 dozen columns of information about each of those calcs, that you can sort, re-arrange and filter. You can easily find the biggest calculation in your system, or all the commented out calcs, or all the portal filters, or calcs that can’t possibly work, because of disconnected contexts or… or …etc.  The list goes on and on. See the docs for more information or watch the videos on this post.

Now if you have a slow layout, you can just start with the list of calcs defined on that layout. Every calc on that layout is there. If you have a slow layout, it is almost certainly because of calcs that take a while to resolve. The culprit is probably on that list. Use the FileMaker Calculation Analysis information in the columns to help you locate it.

Problems Solved

Many of the problems come from calculations getting copied and pasted around in the form of conditional formatting, hide calcs, portal filters, button params etc.  These calcs may have worked correctly at one time but now are pasted into a context that no longer makes sense.  Sometimes the calcs are disabled when this happens if there is no valid path to the table occurrences it needs.  But sometimes there is a valid path. It’s just the wrong path.  And it could be slowing your system down or leading to unexpected behavior.

Selector Connector based systems are vulnerable to this because it intentionally creates a valid path to just about every part of your graph.  One of the columns in the detail list is a list of TOs that are touched. Selector Connector users can use the TO List to make sure that layout calcs like formatting, hiding or portal filter calcs don’t pass through the Selector Connector TOs, which is a sign that something is amiss.

FMPerception can help you find and fix all those problems, plus much more that we haven’t even thought of yet. It keeps expanding our knowledge of how the heart and soul of our FileMaker custom applications work. FileMaker Calculation Analysis?  Yeah. It’s a thing.