Operators
Operators are used to perform operations on variables and values.
There are four operator types:
Assignment operators
There is a single operator for assigning values to variables.
Operator | Syntax | Example |
---|---|---|
ASSIGNMENT |
|
|
Use this operator to create script variables. For example:
[[ Q1data = filterRows(WholeTable, Quarter, q -> q == 'Q1') allQ1Sales = columnsInRegion(Q1data, Sales) currencyFormat(totalVal(allQ1Sales)) ]] |
Arithmetic operators
Arithmetic operators perform arithmetic with values or variables.
Assume that x = 10 and y = 3.
Operator | Syntax | Example | Result |
---|---|---|---|
ADDITION |
|
| 13 |
SUBTRACTION |
|
| 7 |
MULTIPLICATION |
|
| 30 |
DIVISION |
|
| 3.33 |
EXPONENTIATION |
|
| 1000 |
MODULUS (REMAINDER) |
|
| 1 |
Comparison operators
Comparison operators are used in logical statements to compare values or variables.
Assume that x = 10 and y = 10.
Operator | Syntax | Example | Result |
---|---|---|---|
EQUAL TO |
|
| true |
NOT EQUAL TO |
|
| false |
GREATER THAN |
|
| false |
GREATER THAN OR EQUAL TO |
|
| true |
LESS THAN |
|
| false |
LESS THAN OR EQUAL TO |
|
| true |
Logical operators
Logical operators are used to combine or negate individual conditions.
Assume that x = 20 and y = 30.
Operator | Syntax | Example | Result |
---|---|---|---|
AND |
|
| false |
OR |
|
| true |
NEGATION |
|
| false |