Expressions
You can create expressions (formulas) directly in the dashboard components. It can thus display calculated values that are not present in the data source file/spreadsheet.
To create the expression (formula) in the components, the component must support the addition of the special column Expression (Formula).
Below are details about how the expressions work:
Contents
Basic structure of a Expression (Formula)
Value Operand
It's the numerical values. You can use both while values and decimal values. For decimal values, the decimal separator should be the point.
- Examples: 1, 1.05, 2.55
Text Operand
It's the text operands. If you want to use this type of operand in a expression, you must delimit them by the single quotation mark (').
- Examples: 'John Snow', 'California', 'Spaghetti'
Date Operand
These are values that express any date. To represent a date in expressions the behaviour is similar to text operands, i.e. the content must be surrounded by single quotation marks ('). However, the mask dd/MM/yyyy must be used.
- Examples: '01/01/2019', '14/11/2019', '25/12/2019'
Boolean Operand
They're operators of the true or false type. Normally user to validate, or not, a condition in a more complex expression.
- Examples: true, false
Parentheses
Used to group and separate parts of on expression. Expressions within parentheses are processed first.
- Example: ("Profit"/"Total Price") + 10
System variable Operand
These are predefined variables in the system. To use the system variables you must precede them by hashtag (#) and delimit them by double quotes("). Currently only the "#null" variable is available and indicates null content.
- Example: IF("Product" == "#null";0;20)
Arithmetic Expressions
Arithmetic expressions relate two operands (which can be any the operands described above, or another expression) to make up the sum, subtraction, multiplication or division.
Sum (+)
Add two value operands or another expression result. Represented by the + charecter.
Syntax:
<operating or expression result> + <operating or expression result>
Example:
"Taxes" + "Commissions"
Subtraction (-)
Subtract two value operands or another expression result. Represented by the - charecter.
Syntax:
<operating or expression result> - <operating or expression result>
Example:
"Price" - "Taxes"
Multiplication (*0
Multiplies two value operands or another expression result. Represented by the multiplication charecter *.
Syntax:
<operating or expression result> * <operating or expression result>
Example:
"Quantity" * "Unit Price"
Division (/)
Divide two value operands or another expression result. Represented by the division charecter /.
Syntax:
<operating or expression result> / <operating or expression result>
Example:
"Price" / "Quantity"
Relational Expressions
Relational expressions compare two operands (value/text or other expression) to assess whether a condition is true or false. Normally used with decision functions, such as IF.
Equality (==)
It compares if two operands are the same, returning true if they are the same or false if they are different. Represented by the equality operator ==.
Syntax:
<operating or expression result> == <operating or expression result>
Example:
IF("Product" == "#null";0;20)