...
Type | Description |
---|
Array | A list values, e.g. [1,2,3]. For details about what other values arrays can hold and Array handling in general see Arrays and Record Sets. |
Date | A date. For details about date manipulation functions go to Date Functions. |
Datetime | A date and time. For details about date manipulation functions go to Date Functions. |
Float | A floating point number, e.g. 3.2 or 3.0 or 0.0 |
Integer | An integer, e.g. 3 or 0 |
Number | An integer or floating point number |
String | A string value, e.g. "Hello" or the empty string "" |
Boolean | A logical value of either true or false. Note that any non-null, non-zero value is treated as true |
Regular Expression | Regular Expressions allow string patterns to be expressed. See Regexp ToDelete for more details |
$-variables
In stream attribute expressions that have complex calculations, you may need a dummy variable to hold the result of a calculation. You can then reference the variable later in the expression, or in other attribute expressions. In PhixFlow you can use a $-variable for this, by prefixing the variable name with the $ symbol.
Tip |
---|
It can be helpful to distinguish between $-variables that are: - only used in the current attribute: use a lower case variable name, for example
$percent - also used in another attribute: use an initial capital letter, for example
$Percent .
|
Panel |
---|
title | Simple $-variable example |
---|
|
The following expression sets 2 variables A and B , then uses them in a simple calculation that returns 10. To make these variables reusable in other expressions, they are prefixed with the $ symbol. returns a value of 10 Code Block |
---|
do(
$A = 5,
$B = 2,
$A*$B
) |
Another expression can reference $A and $B to return 100. Code Block |
---|
do(
$c = 10,
$A*$B*$C
) |
|
$-variables are useful in the following scenarios.
- "caching" look-up values that you need in multiple attributes
- In the first attribute, look-up the value
- Use a $-variable to store the value that is returned by the look-up
- When you need the value in another attribute, reference the $ variable instead of repeating the look-up.
- ForEach loops (see the function)
- Look up pipe use.
- Really complicated expressions, where I want to break up the use of multiple consecutive functions into separate lines, so I use a $ variable to store the intermediate values.
Assigning values from a Pipe
...