Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TypeDescription
ArrayA 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.
DateA date. For details about date manipulation functions go to Date Functions.
DatetimeA date and time. For details about date manipulation functions go to Date Functions.
FloatA floating point number, e.g. 3.2 or 3.0 or 0.0
IntegerAn integer, e.g. 3 or 0
NumberAn integer or floating point number
StringA string value, e.g. "Hello" or the empty string ""
BooleanA logical value of either true or false. Note that any non-null, non-zero value is treated as true
Regular ExpressionRegular Expressions allow string patterns to be expressed. See Regexp ToDelete for more details

$-variables 
Anchor
$-variable
$-variable

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
titleSimple $-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
    1. In the first attribute, look-up the value
    2. Use a $-variable to store the value that is returned by the look-up
    3. 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

...