DataGraph

# Built-in Functions

DataGraph has over 70 built-in, or named, functions. Functions can be used anywhere in DataGraph that accepts numerical values. These built-in functions can be used to:

## Examples

Function input can be numbers, variables, or column names.

Some functions accept multiple inputs (i.e., a list of numbers). For example, the sum function can accept multiple inputs with commas in between such that: sum(1,2,3) = 6.

The List of Input functions is useful for row operations across multiple columns. For example, the row-by-row sum of three columns A, B, and C can be computed as sum(A, B, C).

The remaining functions have a specified number of input arguments. For example, the standard functions have one input and one output, sin(0.5) = 0.47943.  If a column with multiple entries is input, the output will be computed row-by-row.

## Multiple Inputs

These functions act on a list of inputs of any length. You can input single numbers separated by commas, or enter a comma-separated list of column names. For example, if you have three columns named A, B, and C, you can sum the values in each row by entering, sum(A, B, C) in an Expression column.

NOTE: If you need to perform similar calculations for all entries in a column (e.g., sum a column of numbers), use the column properties or create a number from column variables. The Pivot command can also perform calculations.

## Standard Functions

Function input can be numbers, variables, or column names. When the input is a column with n row values, the function will output n results.

## Ternary Functions

The ternary functions calculate the relative amounts of three values and map them from a three-coordinate system (a,b,c) into the corresponding x and y locations in a cartesian coordinate system. One function provides the x location and another function provides the y location. The (x,y) output from the ternary functions can be used in any drawing commands (e.g., points, plot).

NOTE: The bottom left corner is the relative value of “a”, or where “a = 1”. The values for “a,b,c” move counterclockwise around the triangle. Place a negative in front of the functions to flip the triangle in the vertical direction.

## Date & Time Functions

The Date column internally uses a Unix or POSIX time format (seconds since Jan 1st, 1970). The following functions allow you to create date columns, or manipulate existing date columns to pull various values from them (e.g., week, month, …) using an Expression column.

NOTE: Hour is from 0 to 24 (24 means the next day).

## Statistical Functions

The functions for generating random numbers (rand and nrand) are only available in the Expression column. The other functions can be used in Expression columns or Expression variables.