Skip to main content
Skip table of contents

Loop

Within the execution of Jabatix NC, a loop can be run through in order to perform the calculations for multiple reference dates.

It must be specified how many and for which reference dates calculations are to be performed.

Using this Function

Syntax

In the Control File, a loop can be called up as follows:

CODE
loop over k periods
...

Parameters

[k]

Number of reference dates for which a calculation is to be performed.

[periods]

Denotes the frequency of the calculation.
The value of this parameter is entered directly in the Control File:

years → yearly calculation
months → monthly calculation
quarters→ quarterly calculation

Yearly Calculations

If you want the calculations to be made on an annual basis, but your historical or current data is only available per month or quarter (which then also applies to the frequency of the calculation), the keyword ‘yearly’ can be used when calling up a function in the Control File (cf. the examples below). In this case, the values calculated during the year are adjusted accordingly (i.e. linearly interpolated).

Special Case: Income Statement

Within the Input Files | Financial-Data, it is possible to declare a business figure as an income statement account by filling the column ‘P&L account flag’ with ‘yes’. Jabatix NC then knows that such business figures shall be treated as income statement accounts in the calculations.

In case of monthly or quarterly calculations for income statement accounts, the following holds:

  • After each calculation for year-end, the values of all income statement accounts are set to 0.

  • The values of each income statement account are cumulated until the end of the year.

  • If no command is specified in the Control File for an income statement account, the value of the account in the k-th month amounts to k/12 of the value of the account from the last year-end.

  • If a calculation is made for an income statement account during the year, the value of the account from the last year-end is first distributed linearly over the periods of the new year prior to the calculation.

Examples

The examples below are based on the following data:

  • [balance sheet account] with value 10,000.00 on 31/12/2023

  • [income statement account] with ‘P&L account flag’ = ‘yes’ and value 10,000.00 on 31/12/2023

Example 1

CODE
loop over 24 months
[balance sheet account] + 1200

Value of [balance sheet account] on:

  • 31/01/2024: 10,000.00 + 1,200.00 = 11,200.00

  • 29/02/2024: 11,200.00 + 1,200.00 = 12,400.00

  • 31/03/2024: 12,400.00 + 1,200.00 = 13,600.00

  • ...

Example 2

CODE
loop over 24 months
[balance sheet account] yearly + 1200

Value of [balance sheet account] on:

  • 31/12/2024: 10,000.00 + 1,200.00 = 11,200.00

    • 31/01/2024: 10,000.00 + 1,200.00 / 12 = 10,100.00

    • 29/02/2024: 10,000.00 + 1,200.00 * 2 / 12 = 10,200.00

    • ...

  • 31/12/2025: 11.200.00 + 1,200.00 = 12,400.00

    • 31/01/2025: 11,200.00 + 1,200.00 / 12 = 11,300.00

    • 28/02/2025: 11,200.00 + 1,200.00 * 2 / 12 = 11,400.00

    • ...

Example 3

CODE
loop over 6 months
[balance sheet account] + (100, 200, 300, 100, 200, 300)

Value of [balance sheet account] on:

  • 31/01/2024: 10,000.00 + 100.00 = 10,100.00

  • 29/02/2024: 10,100.00 + 200.00 = 10,300.00

  • 31/03/2024: 10,300.00 + 300.00 = 10,600.00

  • 30/04/2024: 10,600.00 + 100.00 = 10,700.00

  • 31/05/2024: 10,700.00 + 200.00 = 10,900.00

  • 30/06/2024: 10,900.00 + 300.00 = 11,200.00

Example 4

CODE
loop over 24 months
[balance sheet account] yearly * (0.76, 1)

Value of [balance sheet account] on:

  • 31/12/2024: 10,000.00 * 0.76 = 7,600.00

    • 31/01/2024: 10,000.00 - (10,000.00 - 7,600.00) / 12 = 9,800.00

    • 29/02/2024: 10,000.00 - (10,000.00 - 7,600.00) * 2 / 12 = 9,600.00

    • ...

  • 31/12/2025: 7.600.00 * 1 = 7,600.00

    • 31/01/2025: 7,600.00

    • 28/02/2025: 7,600.00

    • ...

Example 5

CODE
loop over 24 months
[income statement account] + 5%

Value of [income statement account] on:

  • 31/01/2024: (10,000.00 / 12) * 1.05 = 875.00

  • 29/02/2024: 875.00 + (10,000.00/12) * 1.05^2 = 1,793.75.

  • 31/03/2024: 1,793.75 + (10,000.00/12) * 1.05^3 = 2,758.44

  • ...

  • 31/12/2024: 12,430.94 + (10,000.00/12) * 1.05^12 = 13,927.49

Example 6

CODE
loop over 24 months
[income statement account] yearly + 5%

Value of [income statement account] on:

  • 31/12/2024: 10,000.00 * 1.05 = 10,500.00

    • 31/01/2024: 10,000.00 * 1.05 / 12 = 875.00

    • 29/02/2024: 875.00 + 10,000.00 * 1.05 / 12 = 1,750.00

    • 31/03/2024: 1,750.00 + 10,000.00 * 1.05 / 12 = 2,625.00

    • ...

  • 31/12/2025: 10,500.00 * 1.05 = 11,025.00

    • 31/01/2025: 10,500.00 * 1.05 / 12 = 918.75

    • 28/02/2025: 918.75 + 10,500.00 * 1.05 / 12 = 1,837.50

    • 31/03/2025: 1,837.50 + 10,500.00 * 1.05 / 12 = 2,756.25

    • ...

Example 7

Monthly frequency of calculation, but no command for [balance sheet account] in the Control File.

Value of [balance sheet account] on:

  • 31/01/2024: 10,000.00

  • 29/02/2024: 10,000.00

  • 31/03/2024: 10,000.00

  • ...

  • 31/12/2024: 10,000.00

Example 8

Monthly frequency of calculation, but no command for [income statement account] in the Control File.

Value of [income statement account] on:

  • 31/01/2024: 10,000.00 / 12 = 833.33

  • 29/02/2024: 10,000.00 * 2 / 12 = 1,666.66

  • 31/03/2024: 10,000.00 * 3 / 12 = 2,500.00

  • ...

  • 31/12/2024: 10,000.00 * 12 / 12 = 10,000.00

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.