Types
=SINE(0.5 * PI * @Value)
Generally, there are five different types that can be used in the Lucid formula system: strings, numbers, booleans, arrays and objects. Additionally, there are built-in constants (such as PI
) above.
String
Strings are text values that represent a sequence of characters. For example, "Hello, World", "Test", 'Demo123' are all examples of strings. Strings are constructed by paired single (') or double (") quote characters. A string is started with one of the quote characters and is terminated with the same quote character. If a string is uncompleted, the formula will be invalid.
Within a string, the same quote character can be included without stopping the string by doubling the character. Newlines can be added to a formula string in the editor by press shift+enter to add a line break; the line must still be terminated with a matching quote character, however.
Example | Result |
---|---|
"Joe said, ""Hello, World""." | Joe said, "Hello, World". |
'It isn''t correct' | It isn't correct |
"It isn't correct" | It isn't correct |
'A B' | A B |
Number
Numbers are numeric values that can be integers (-1, 0, 2, etc.) or decimal numbers (0.25, 1.234, etc.). Numbers should not include commas for place separators (for example, 1,000,000 is not a valid number).
Numbers can be defined using scientific notation, which defines the number as a factor and a power of 10. Scientific notation is in the form MeN, which translates into the value (M × 10N). For example, 1.23e4 translates into the value 12300.
Numbers can also be defined as percentages by adding a percent sign at the end (for example, 1.23%). The value used for calculations will be divided by 100 (for 1.23%, the value 0.0123 would be used), but the percentage will correctly display as a percentage in the data property editor.
Example | Result |
---|---|
1234 | 1234 |
1.23e4 | 12300 |
1.23% | 0.0123 (displayed as 1.23%) |
Boolean
Booleans are either true or false and are used in boolean logic (for example, functions like IF
, AND
, OR
, etc.).
Array
Arrays are an ordered collection of values indexed by contiguous integers starting at 1. More details can be found here.
Object
Objects are structures that contains key-value pairs. More details can be found here.
Container type
Specific types of containers that can be used for filtering. Examples can be found here
Container type | Description |
---|---|
$COLUMN | Column shapes (Ex: column in Dynamic Table) |
$CONTAINER | Any container shapes |
$DYNAMICTABLE | Dynamic Table shapes |
$ROW | Row shapes (Ex: row in Timeline) |
$SMARTCONTAINER | Smart Container shapes |
$SUBCONTAINER | Any subcontainer shapes (Ex: rows or columns) |
$SWIMLANE | Swimlane shapes |
$SWIMLANELANE | Individual lanes within a swimlane shape |
$TIMELINE | Timeline shapes |
$VENNCIRCLE | Venn diagram circle shapes |
Built-In Constants
In the Lucid formula system, some predefined constants can be used to simplify formula writing.
Constant | Value | Description |
---|---|---|
E | 2.718281828459045 | The mathematical constant e, which represents the base of the natural logarithm |
PI | 3.141592653589793 | The mathematical constant pi. Useful when performing trigonometric functions, such as COS or TAN |
NONE | undefined | Returns undefined |
Updated 6 months ago