Performance considerations
When working with a small dataset and an efficient database, you often won’t notice inefficient calculations. With larger datasets, the efficiency of your calculations can start to make a difference to the speed at which a view is rendered.
Here are some tips for making your calculations as efficient as possible:
- Boolean and numeric calculations are much faster than string calculations. If possible, avoid string manipulation and use aliasing or formatting to provide user-friendly labels. For example, don’t write the following code:
IF [value] == 1 THEN "Yes" ELSE "No" END
. Instead, simply write[value] == 1
, and then edit the aliases of the field and setTrue
toYes
andFalse
toNo
. - Look for ways to increase the efficiency of a calculation. If you find yourself writing a long
IF ELSEIF
statement with lots of conditions, see whether there are one or two conditions that you can check first to eliminate...