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 fairly dramatic difference to the speed at which a view is rendered.
Here are some tips for getting the most efficiency in your calculations:
- Boolean and numeric calculations are faster than string calculations. If possible, avoid string manipulation and use aliasing or formatting to provide user-friendly labels. For example, don't write this code:
IF [value] == 1 THEN "Yes" ELSE "No" END
. Instead, simply write[value] == 1
and then edit the aliases of the field and setTrue
to"Yes"
andFalse
to"No"
. - Always 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 if there are one or two conditions that you can check first to eliminate checks of all the other conditions. For example, let's consider...