Versions Compared

Key

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

Attribute functions Functions are used for performing calculations on data in PhixFlow. The most common uses are:

  • populating output stream attributes;
  • building filters.

This is the list of all attribute functions:

Page Tree
expandCollapseAlltrue
root@self
excerpttrue
searchBoxtrue

Concepts

This section introduces some key concepts that are crucial to understanding how these functions work in PhixFlow. The concepts are should be fairly straightforward for anyone used to using excel, or any type of database. But PhixFlow is capable of supporting some complex transformations, where needed, and it is important that you are comfortable with these concepts before setting up elaborate function configurations.

Anchor
termAndConv
termAndConv
Terminology and conventions

In examples in the following descriptions, function are given as out.calls = ifNull(in.numCalls, 0, 1). In this format, there are three sections of each expression:

...

Where a function can take, as one of its arguments, a list of values this is expressed in square brackets, e.g.:
function([value1, value2, ...])
See Arrays and Record Sets for details of how lists are handled in functions. Such a list is often called a vector. Indexes: always start at 1. Many functions return an index, indicating the position in a list at which a matched value has been found. E.g. see getElement.

Anchor
processingLists
processingLists
Processing lists of values

Where a function can take a list of values as one of its arguments, the argument will often be an attribute of an input stream, or an expression based on an attribute of an input stream. For example: sum(in.value) where in is an alias for an input stream containing the numeric attribute value. When used as part of a merge or aggregate function, for example, the argument in.value will resolve to a list of values - all the values of value associated with a particular key combination.

Anchor
dataTypes
dataTypes
Data types

  • float: a floating point number
  • integer: an integer
  • string: a string
  • date: there is no actual date type is PhixFlow; dates are handled as string, but these must have a particular format, either:
    • "yyyymmdd.hhmmss", or
    • "yyyymmdd".

Anchor
expressionOperators
expressionOperators
Expression operators

The following relational operators are available:

...

  • + (add; can also use the attribute function sum)
  • - (minus; can also use the attribute function sum, reversing the sign of the second operand)
  • / (divide)
  • * (multiply)

Responsive Attribute Functions 
Anchor
client_functions
client_functions

To improve performance, the functions listed below can be evaluated by the client rather than the server. These are useful where you want an expression to be evaluated quickly, for example in formatting rules.

...