CALCULATENI

Metadata Instruction: Perform a calculation with an integer output (no decimals) or type cast a string into an integer

Use Cases - When to use this command

Description

CALCULATENI evaluates a mathematical expression and stores the output integer of the expression in another variable. If the output of the expression is a Float (a number with decimal places), then output will be forced into integer form and rounded off to the nearest whole number.

Guidelines for Usage:

How to use this command

CALCULATENI command is for node level operations. It can be used in any node as an instruction, except for the root node. It should not be used on the Arrows.

Let's take an example: CALCULATENI $output_variable "25 + 45"
Here, "$output_variable" is where the result of the expression "25 + 45" will be stored.
If you had a tree variable "$x1" which was previously initialized to 45, the above expression could have also been "25 + $x1"

Examples

Simulated Metadata Editor (with built-in tree variable $summertime_premium=300)
processing icon
Analytics API Call Body
Analytics API Response Body