Skip to content

Calculation#

Mathematical Expressions#

The Calculation node uses the mXparser library to support many mathematical functions.

In order to add/subtract/multiply the current value when the node is inside a loop use: {CURRENT_CALCULATION_VARIABLE} ±/*/ {ANOTHER_NUMBER_VARIABLE} or some number. For example:

"Calculation node/Result" + "Loop over Order/Quantity"

Functions#

Next to the evaluation of mathematical expressions specified above, the calculation node also offers several special functions that can be used in a Flow.

Function Description Example
~~setVar(var,value)~~ ~~Set a Flow variable to a specific value~~ ⚠️ Deprecated
durationDate(date1,date2) Returns the number of days between date1 and date2 If date1 is "2025-04-01" and date2 is "2025-04-07", the function will return 6 as there are 6 days between these dates.
durationTime(time1,time2) Returns the number of seconds between time1 and time2 For example, if time1 is "10:00" and time2 is "10:30", the function will return 1800 seconds, as there are 30 minutes (or 1800 seconds) between the two times.
durationTimestamp(ts1,ts2) Returns the number of seconds between ts1 and ts2 For instance, if ts1 is "2025-04-08T10:00:00" and ts2 is "2025-04-08T11:30:00", the function will return 5400 seconds, which corresponds to a duration of 1 hour and 30 minutes.
durationTimeOvernightSafe(time1,time2) Returns the number of seconds between the two time stamps time1 and time2.
If the end time (time2) occurs before the start time (time1), indicating an overnight period, the function correctly adds 24 hours to calculate the duration.
For example, if time1 is "23:00" and time2 is "01:00", the function will return 7200 seconds, which represents a 2-hour duration.

See Flow Designer