C3 includes an expression evaluation system to make it easy to build simple functions. Essentially, they are one-line Java expressions.

C3 Expressions are used all over the C3 AI Suite.

The C3 AI Suite supports a java-like expression syntax allowing the user to define complex functions quickly and easily throughout the Suite. This pseudo-language supports basic arithmetic and boolean operators as well a large set of built-in functions known as the ExpressionEngineFunctions.

Here are some useful techniques and syntax which is available in C3 Expressions, but which may not be easy to find in current documentation

Supported Syntax

Special keywords

this

Sometimes, it may be useful for a timeseries to refer to itself, or to get a reference to the 'current' timeseries. This is done with the this name. For example, we can specify the transform field of a TsDecl metric to do some transformation of the data before it heads to normalization. We can use the fillMissing function to fill gaps in the data with a specified value. We'd specify this with fillMissing(this, <value_to_fill>).

Esspecially Useful Expressions

Ternary Operators

Ternary Operators are widely useful throughout the C3 AI Suite. They allow small conditional expressions which can affect the return value of your expression.

Timeseries expressions

Official Documentation