Formulas in the hours calculation

Added

An hours calculation setting of type Formula does not count shift hours; it calculates them from other columns — e.g. overtime as the sum of work minus the monthly norm. This guide explains how to write a formula, which variables exist and what the errors and warnings shown on saving mean. Settings basics: Hours calculation settings — basics and examples.

1. Where you enter a formula

  1. In the left menu, open the ADM tab (if shown), open the Shift planning group, select Shift planning and click the Settings (gear) button.
  2. Click Add setting, or the pencil icon in the row of an existing setting.
  3. In the Calculation type section, choose Formula. Section 3 becomes Formula, with the input field and the Insert buttons.

2. Writing a formula

A formula calculates the column's hours from other columns. Write column codes in square brackets: [RR], [NR].

What you can use

  • Codes of standard settings: [RR], [NR], [GO]…
  • The variables [MN], [MNZ] and [Employee.Polje].
  • The operators + - * / and round brackets.
  • Decimals with a dot or a comma: 0.5 or 0,5.

Rules

  • A formula cannot use the code of another formula — such a code counts as 0.
  • An unknown code counts as 0.
  • A negative result is shown as 0.

Example: ([RR]+[NR])*0.5 = half of the sum of regular and night work.

The Insert buttons below the field add a code at the end of the formula, so you do not have to type the brackets.

3. Variables

VariableMeaning
[MN]Monthly norm: the number of working days (Monday–Friday) in the month × 8 hours.
[MNZ]The employee's maximum working hours in the month — like MN, but counting only the days between the start and end of employment if the employee joined or left during the month.
[Employee.Polje]The value of an additional employee field; replace Polje with the field's system name. An empty field counts as 0.

Example

The month has 22 working days: [MN] = 176. The employee started on the 15th and has 11 working days until the end of the month: [MNZ] = 88.

4. Errors and warnings on saving

When you click Save, the app checks the formula.

Errors — the formula is not saved

  • Enter a formula — the field is empty.
  • Code is not in square brackets — e.g. (DR+[NR])*0.3. The app suggests the fix ([DR]+[NR])*0.3; clicking Apply suggestion puts it in the field.
  • The formula is not valid — check the brackets and operators (e.g. an extra bracket, two operators in a row).

Warnings — saving after confirmation

If the formula uses a code that does not exist as a standard setting, or is itself a formula, the calculation uses 0 for that code. The app shows this; if it is intended, click Save again with the same formula.

Changing or deleting an abbreviation

When you change or delete an abbreviation that formulas use, those formulas calculate 0 for the old code until you fix them.

5. Example formulas

ColumnFormulaMeaning
Total work[RR]+[PR]+[NR]sum of all work columns
Overtime[RR]+[PR]+[NR]-[MNZ]hours above the employee's monthly norm (below the norm = 0)
Night work allowance[NR]*0.330% of night hours
Half of the sum([RR]+[NR])*0.5half of the sum of regular and night work

6. Where to go next

  1. Hours calculation settings — basics and examples — all other fields of the form and the column order.
  2. Shift planning — overview — where the hours columns are shown.