Expression column
The Expression column allows you to compute and derive numerical values.
Related Articles:
For more information see:
How to create
Click the expression column button to create a new column.
Use column names from numerical columns in mathematical expressions.
Calculations are performed on each row.
Forming expressions
The expression column uses arguments that are either columns or global variables. An expression like 2x+y, where 2x is understood as 2*x, has two arguments ‘x’ and ‘y’. If x and y are names of numerical columns, the expression column will use the rows where the x and y columns have values.
DataGraph uses standard mathematical operators, but also has a long list of built-in functions and even logical operators.
Options
Missing
Missing let’s the value in a column be replaced with a valid number, if it otherwise is blank.
Type
A function can output a number or a date.
Display
The Display options are different depending on the Type.
# of Rows
When you enter a constant into the expression field, an additional entry box is shown that requires the number of rows to be specified.
You can enter a numerical value or global variable to return a specified number of rows.
Example: Set the column length equal to another column
Let’s say you want to add a constant value column with row length based on another column. You have two options:
- Set the ‘# of Rows‘ to a Number from Column variable set to the length, OR
- Use the expression ‘Data*0 + Constant’
To illustrate, see what happens when we set the expression equal to another column.
If we multiple the column values by zero, we get a column of zeros that is the same length.
We can add a constant numerical value or a column property that returns a single value.
This approach is a bit of a trick but a quick way to force the length of an expression column to come from another column.