Functions

You can use three types of functions when constructing formulas: Table Lookups, Conditionals, and MIN/MAX functions. All are explained below.

Table Lookups

Use the f.TableValue(row, column) and f.GradientValue(value, column) functions to look up values in formula (tax) tables. Use the f.GradientValue function to look up information in a graduated tax table that has multiple rows or lines in ascending order, like the FED__FWH and PMN__SWH tables. The f.TableValue function is used to look up information in a table that is not arranged with graduated multiple rows, like a PMN__SUI table. Use the f.TableValue and f.GradientValue functions to have the formula look up values in formula tables that have been set up in the ST database (without the Show Company Specific Tax Tables box checked) and to have the formula look up values in formula tables that have been set up in the company database (with the Show Company Specific Tax Tables box checked).

Conditionals

You can use the IF(x, y, z) function to evaluate formulas conditionally. If condition x is true, then perform y, else perform z.

For example:

if L1 > f.GetNumericVariable(“FC1”):

   L3 = L2

else:

   L3 = 0.

If the value of L1 is greater than FC1, we return a value of L2; otherwise we return the value of 0.

NOTE: It is important to use a constant number of spaces as indentations for the lines following the if and else command lines. The example above uses 3 spaces as indentations. At the end of the if and else command lines you must use a colon: to indicate what the next condition is.

MIN/MAX functions

If you wish to test the values of two variables, and have the larger value returned, you can use the function MAX(value,value). Conversely, if you wish to test the values of two variables, and have the lesser value returned, you can use the function MIN(value,value).

Back to top of page