# Special functions

We developed functions to facilitate working with time series, fill in gaps or missing data points, allow conditional statements, cumulative sums and, shift the position of the elements inside.

Many synthetic expressions require two or more variables, in those cases, each of the values to be computed must have the same timestamp, otherwise the engine will not compute the expression. * Fill missing()* can help in these cases, as it fills the gaps where there is a missing value in any of the variables used within the expression. The syntax for this function is as follows:

** fill_missing (expression, <first_fill>, <last_fill>, <fill_value>)**

### Examples

A conditional expression is required in some cases to generate an outcome. The * where()* function is an if-else statement that executes one of two actions depending on whether the input condition is True or False. The syntax for this function is as follows:

** where(condition, operation if true, operation if false)**

Computes the operation *operation_if_true*, if the condition is true otherwise it will execute the *operation_if_false.*

This function calculates the difference staring at the last element in a time series and the next separated by a specified number of steps. The syntax of this function is as follows.

** ****diff(<variable>,<steps>)**

The function returns the variable's values in the time series shifted by the given number of steps. The syntax of this function is as follows.

** shift(<variable>,<step> )**

This function returns the cumulative sum of a time series. The syntax of this function is

Last updated