To access a table entry in a row other than the current one, follow
the column's name with a row offset within curly braces. For
example, PHA{-3}
will evaluate to the value of column PHA, 3 rows
above the row currently being processed. One cannot specify an
absolute row number, only a relative offset. Rows that fall outside
the table will be treated as undefined, or NULLs.
Using the same column name on the left and right side of the equals
sign while using the COLUMN{-N}
notation will not produce the desired
result. For example,
COUNT = COUNT{-1} + 1; # BAD - do not usewill not produce an increasing counter. Such recursive calculations are often not possible with the calculator syntax. However, for cases where the user wishes a row counter, the special variable
#ROW
can be utilized.