To work with the tool in Foresight Analytics Platform 10, use the new interface.

Debugging Calculation Algorithm

Debugging calculation algorithm is used to detect and correct errors and also enables the user to view intermediate values obtained during calculation. Viewing intermediate values is specially relevant if calculation uses intermediate cubes without data tables, that is, the cubes that cannot be used to view obtained values after algorithm calculation is finished.

To debug algorithm:

  1. Set up calculation execution using the Set Up Calculation Execution dialog box.

Open the dialog box

Set parameters:

To correct the specified formula, click the Stop button, after which algorithm calculation will be stopped. Manually edit the formula and recalculate the algorithm.

To skip the error, click the Skip button. After this calculated elements will be skipped and the calculation result is the empty value.

If the checkbox is deselected, arithmetic operations in formulas are not checked. If there is a division by zero, calculated elements are skipped and the calculation result is an empty value.

NOTE. It is possible to not check arithmetic operations if calculation formula is correct and the calculation result can contain empty values.

Formula calculation schemes

NOTE. The checkbox is available if the calculation algorithm contains calculation blocks and control blocks , for which calculation formulas are set.

If the Pointwise Calculation checkbox is selected for specific calculation formulas, calculation can be executed using several methods. Formula calculation methods are given on the schemes below.

Formula calculation schemes

If a calculation formula contains elements of version dictionary attribute, on calculating the algorithm, elements values will be fixed on the calculation start date for each calendar point. To rebuild elements values to the current calculation date for each calendar point, create the MsUseRDSVersions parameter of the REG_DWORD type with the 1 value in the registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Foresight\Foresight Analytics Platform\10.0\Debug] on local computers of all users.

IMPORTANT. The parameter use decreases performance, and algorithm calculation takes more time.

If a calculation algorithm contains aggregation blocks, aggregation mode for one calendar point is not possible when algorithm pointwise calculation is used. Select aggregation block calculation method using the radio buttons:

NOTE. The order of aggregation blocks calculation in the calculation tree is taken into account only when pointwise calculation is used for specific calculation formulas. When pointwise calculation of algorithm is used, the order of aggregation block calculation depends on the selected calculation method.

To apply the specified parameters, click the Apply button.

  1. If in different blocks different selection of the same source is used, select the Load Data Separately from the Rest checkbox in the context menu of the blocks in calculation tree. In this case, separate data loading is more quickly and reduces the total algorithm calculation time. The checkbox is available for all block types.

  2. To debug the entire algorithm, click the Calculate Algorithm button in the Debug group.
    To debug single blocks, select them in the working area or calculation tree. To do this, use the SHIFT key in the working area, and the CTRL or SHIFT key in the calculation tree. After blocks are selected, click the Calculate Selected button in the Debug group.

  3. After calculation is started, data is loaded to algorithm. After loading is finished, the Continue becomes available. Click it to go to the next calculation step.

The calculated block turns green in the working area. For example, left - the block before calculation, right - the block after calculation:

  1. To go to the specific calculation step, select it in the drop-down menu of the Continue button. The menu contains all the steps that have not been yet executed.

  1. To stop calculation, click the Stop button in the Debug group.

All calculation algorithm objects can be read during debug. For example, the user can check calculation block settings or open block calculation results in the Analytical Queries (OLAP) tool.

NOTE. If on setting up calculation execution, the Do Not Save Result to Database checkbox is selected, but after the calculation is finished, the results must be saved, then click the Save Values button in the Calculation Parameters group.

After debug is finished, the dialog box with results opens. For example:

If an error occurred on calculation, the corresponding message is displayed.

NOTE. If the calculation algorithm structure contains branchings, branch execution conditions are checked on algorithm calculation. As a result of check, only the data sources are loaded, which are specified for objects contained in the branches satisfying the conditions. This optimization speeds up data loading.

To speed up algorithm calculation, see the How to Speed Up Algorithm Calculation? section.

Example of Calculation Algorithm Debug

The example presents a step-by-step calculation algorithm. Data consumer of one block will be opened before and during calculation.

See also:

Getting Started with the Calculation Algorithms Extension in the Web Application | Building Calculation Algorithm| How to Execute Multithreaded Calculation?