Table of Contents

Setting Column Formula

There are two ways to set formula for column evaluation:

1. Select column and write formula in formula string.

Image

2. Use Table → Set Column Formula menu item to open column formula dialog window. See Expression Syntax for details.

 Set column formula dialog

Row Index

Variable i contains the current row index. Rows are enumerated from 1.

Rows Evaluation Order

Rows are always evaluated one after another from the first to the last in the specified range. Accordingly the row number i is incremented after each step.

Example

Using Table Data

There are two functions to obtain current table cell values in formula:

You can use either upper-case letters (A…Z, e.g. col(B)) or numbers (1, 2, 3,.., e.g. col(1)) in columns numeration in arguments of col and cell functions.

Example

Auto Recalculation on Data Change

MagicPlot can automatically recalculate formula when data in used columns are changed. Set Auto Recalculate checkbox to enable this feature.

Example

Formula Menu in Column Context Menu

You can edit column formula and change auto recalculation mode from column context menu or menu Table. Select exactly one column and open context menu to view this menu items.

Formula Menu

“Argument is out of range at row #” Warning

Some mathematical functions can be defined only on a certain interval. For example, square root (sqrt(x)) is not defined for negative numbers (all calculations in MagicPlot are made in real numbers, not complex). Hence if the argument of sqrt is negative, a Not-a-Number (NaN) is returned. If a NaN value occurs in some part of formula, the result of calculation will also be a NaN, and corresponding table cells will be empty.

The calculations are not terminated if NaN value occurs in some row(s).

In some cases you may want to check if a NaN values occurs in calculations. MagicPlot shows the warning “Argument is out of range at row #”. This row number is the first row in which NaN value was returned. MagicPlot also highlights the function or operator which first produces NaN value.

See Also