Tabular Functions

This section lists the Dashboard functions that operate on or return tabular data.

Add All Rows Or Columns

Calculates the sum across cells for each row or column of the specified Table.

Usage notes

If Return Column is 1, the function returns a table with one column. The nth cell of the returned column contains the sum of the numerical cells in the nth row of the table specified by the argument Table. (If there are no numerical cells in the row, the returned cell contains 0.)

If Return Column is 0, the function returns a table with one row. The nth cell of the returned row contains the sum of the numerical cells in the nth column of the table specified by the argument Table. (If there are no numerical cells in the column, the returned cell contains N/A, by default—but see the argument Result Label Column, below.) The nth column of the returned one-row table is labeled with the label of the nth column of the table specified by the argument Table.

Arguments

This function has the following arguments:

  • Table: Table for which row or column sums are to be calculated.
  • Return Column: Numeric value that controls whether to return a column or a row of result values. To get a column of result values, one value for each row, set Return Column to 1. To get a row of result values, one value for each column, set Return Column to 0.
  • Result Label: Text string that specifies a label for the result row or column. If not specified, the label text is Total. If Return Column is 0, the label appears only if Result Label Column is set to a column of Table that has no numeric values. If Return Column is 1, the label text always appears and Result Label Column is ignored.
  • Result Label Column: Text string that specifies the column in which Result Label appears, if Return Column is 0. The specified column must have no numeric values in order for the label to appear. If Return Column is 1, this argument is ignored.

This function returns a table.

Example

The second table below is attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog

Illustration showing two tables

Add Columns

Returns a table that includes a column reflecting the sum of two specified columns of a specified table, the sum of a specified value and a specified column, or the sum of two specified values.

Usage notes
  • Case 1: Sum of two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Sum of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Sum of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of adding the corresponding row’s cell in First Column Name or Numeric Value to the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of adding the corresponding row’s cell in the specified column to the specified numeric value.

In case 3, each cell of the returned column contains the sum of the two specified numeric values.

In the returned table, the sum column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be summed.
  • First Column Name or Numeric Value: Text string specifying the first column to be included in the sum, or numerical value to be included in the sum.
  • Second Column Name or Numeric Value: Text string specifying the second column to be included in the sum, or numerical value to be included in the sum.
  • Result Column Name: Text string that specifies the name of the column containing the sums. You must supply a value for this argument.

This function returns a table.

Average All Rows Or Columns

Calculates the average across cells for each row or column of the specified Table.

Usage notes

If Return Column is 1, the function returns a table with one column. The nth cell of the returned column contains the average of the numerical cells in the nth row of the table specified by the argument Table. (If there are no numerical cells in the row, the returned cell contains 0.)

If Return Column is 0, the function returns a table with one row. The nth cell of the returned row contains the average of the numerical cells in the nth column of the table specified by the argument Table. (If there are no numerical cells in the column, the returned cell contains N/A, by default—but see the argument Result Label Column, below.) The nth column of the returned one-row table is labeled with the label of the nth column of the table specified by the argument Table.

Arguments

This function has the following arguments:

  • Table: Table for which row or column averages are to be calculated.
  • Return Column: Numeric value that controls whether to return a column or a row of result values. To get a column of result values, one value for each row, set Return Column to 1. To get a row of result values, one value for each column, set Return Column to 0.
  • Result Label: Text string that specifies a label for the result row or column. If not specified, the label text is Average. If Return Column is 0, the label appears only if Result Label Column is set to a column of Table that has no numeric values. If Return Column is 1, the label text always appears and Result Label Column is ignored.
  • Result Label Column: Text string that specifies the column in which Result Label appears, if Return Column is 0. The specified column must have no numeric values in order for the label to appear. If Return Column is 1, this argument is ignored.

This function returns a table.

Average Columns

Returns a table that includes a column reflecting the average of two specified columns of a specified table, the average of a specified value and a specified column, or the average of two specified values.

Usage notes
  • Case 1: Average of two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Average of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Average of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of computing the average of the corresponding row’s cell in First Column Name or Numeric Value and the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of computing the average of the corresponding row’s cell in the specified column and the specified numeric value.

In case 3, each cell of the returned column contains the average of the two specified numeric values.

In the returned table, the average column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be averaged.
  • First Column Name or Numeric Value: Text string specifying the first column to be included in the average, or numerical value to be included in the average.
  • Second Column Name or Numeric Value: Text string specifying the second column to be included in the average, or numerical value to be included in the average.
  • Result Column Name: Text string that specifies the name of the column containing the averages. You must supply a value for this argument.

This function returns a table.

Baseline Over Time

Calculates a baseline average of the values in the specified table over the specified number of specified date part intervals, and offsets the timestamp to a specified reference time.

Arguments

The function has the following arguments:

  • Table: Data table for which the baseline is to be calculated. The specified table must contain a time column and a number column.
  • Date Part: Text string specifying the date unit to use. Enter s, m, h, d, w, M, q, or y, for seconds, minutes, hours, days, weeks, months, quarters, or years. If left blank, the argument defaults to seconds.
  • Date Parts Per Interval: Number of date parts in each interval over which the baseline is to be calculated.
  • Number Of Intervals: Number of intervals over which the baseline is to be calculated. If this argument is set to 0, the baseline is calculated over all the data in the table.
  • Reference Time: After the baseline average has been calculated over the range of data specified, all values in the resulting time column are offset to start at the given reference time. This provides an easy way for the baseline to be plotted in a trend graph against a current set of values.

The function returns a table.

Example

The trend graph below is attached to the function defined by the following dialog. In the trend graph, the thin, light blue line is the baseline, the average of the data over three one-week periods. The dark blue line is the current data. The first table’s data table is attached to the argument Table. The second table shows the baseline data. Note that the current data for Sunday is lower than the rest of the current data. The graph shows that this is not anomalous, since the baseline data for Sunday is also lower than the rest of the baseline data.

Illustration showing the Edit Function dialog Illustration showing a trend graph

Buffer Table Rows

Appends all rows of the input table to a buffer table that contains rows from previous updates. Returns the buffer table.

Usage notes

This function is useful for buffering a table argument to another function in cases where the updates to the table may arrive rapidly (for example, from an event-driven data source), in order to ensure that the other function receives all rows.

Arguments

The function has the following arguments:

  • Table: Table whose rows are to be appended to the buffer table.
  • Number Of Rows: Numeric value that specifies the number of rows in the returned buffer table. If necessary, older rows are removed to maintain this value.
Info
If the result of this function is used as the input to another function, all rows are removed from the buffer table after the other function is updated, regardless of value of Number of Rows.

This function returns a table.

Combine

Returns the result of combining two specified tables into a single table.

Usage notes

When Combine Rows is 0, the result contains the columns from Table 1 followed by the columns from Table 2. Each result row consists of the nth row from Table 1 followed by the nth row from Table 2. If Table 1 and Table 2 have a different number of rows, trailing result rows are padded with cells that are contain 0 or the empty string.

When Combine Rows is 1 and Ignore Column Names is 0, the result contains the rows from Table 1 followed by the rows from Table 2. The result table contains the column labels from Table 1 followed by the column labels that appear only in Table 2. In the result table, 0 or the empty string appears in cells that are in rows from one table and in a column that appears only in the other table.

When Combine Rows is 1 and Ignore Column Names is 1, the result contains the rows from Table 1 followed by the rows from Table 2. The result table contains only columns that appear in both Table 1 and Table 2.

Arguments

This function has the following arguments:

  • Table 1: Table to be included in the combination operation.
  • Table 2: Table to be included in the combination operation.
  • Combine Rows: Numerical value that determines whether rows or columns are merged. When Combine Rows is 0, the result contains the columns from Table 1 followed by the columns from Table 2. When Combine Rows is 1, the result contains the rows from Table 1 followed by the rows from Table 2.
  • Ignore Column Names: Numerical value that determines which columns are included in the result. When Combine Rows is 1 and Ignore Column Names is 1, the result table contains only columns that appear in both Table 1 and Table 2. When Combine Rows is 1 and Ignore Column Names is 0, the result table contains the column labels from Table 1 followed by the column labels that appear only in Table 2. This argument is ignored when Combine Rows is 0.

This function returns a table.

Example

The third table below is attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table 1, and the second table’s data table is attached to the argument Table 1.

Illustration showing the Edit Function dialog

Illustration showing tables

Concatenate Columns

Creates a string concatenation of the values in the given table columns separated by the given character(s), and returns the results in a new table column. The column names are specified as a semicolon-separated string. The separator can be a single character such as . or / but it can also be a string such as and.

Arguments

This function has the following arguments:

  • Table: Table whose column values are to be concatenated
  • Names of Columns to Concatenate: Columns whose values are to be concatenated
  • Separating Character(s): Separator character, such as . or /, or separator string, such as and
  • Result Column Name: Name of the result column

This function returns a table.

Convert Columns

Returns a copy of the specified table that is modified by converting the specified columns to the specified types.

Usage notes

When converting from numeric types (other than Long) to the Time type, columns are first converted to Long and then to Time. If a String column entry cannot be parsed as a Time, the resulting entry is blank.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to convert.
  • Columns To Convert: Text string that specifies the columns to convert. Supply a single column name or a semi-colon delimited list of column names.
  • Columns To Type: Text string that specifies the target types of the conversion. Supply a single type name or a semi-colon delimited list of type names. Use the following type names: Boolean, Integer, Long, Float, Double, String, or Time. Type names may be abbreviated to the first letter.

This function returns a table.

The second table below is attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog

Illustration showing tables

Copy

Copies the specified Table.

Arguments

The function has the following argument:

  • Table: Table to be copied.

This function returns a table.

Count

Returns the number of rows in the specified table.

Arguments

The function has the following argument:

  • Table Column: Table whose rows are to be counted.

This function returns a numeric value.

Count By Bands

Divides a specified range of values into a specified number of bands and counts the number of rows in a specified data table column that contain a value that lies within each band.

Usage notes

If Return Cumulative Percents is set to 0, this function returns a table containing one column that holds the midpoint values of each band (one row for each band), as well as one column containing the counts.

If Return Cumulative Percents is set to 1, the returned columns will contain the cumulative percentage of the total count in each cell, rather than the individual counts.

Arguments

The function has the following arguments:

  • Table: Data table column.
  • Number of Bands: Numerical value that specifies the number of bands into which to divide the specified range.
  • Include Min/Max: Numerical value (0 for false and 1 for true) that determines whether the range of values is specified by Min Value and Max Value, or by the values in Table.
  • Min Value: Numerical value that, together with Max Value, specifies the range of values that is divided into the bands, if Include Min/Max is 1.
  • Max Value: Numerical value that, together with Min Value, specifies the range of values that is divided into the bands, if Include Min/Max is 1.
  • Return Cumulative Percent: Numerical value (0 or 1) that determines whether counts or cumulative percentages are returned. If set to 1, he function returns the cumulative percentage of the total count in each cell, rather than the individual counts.

This function returns a table.

Count Unique Values

Returns a table that lists unique values and their counts from the specified table column.

Arguments

The function has the following arguments:

  • Table Column: Data table column whose values are to be counted.
  • Value List: Table column that specifies values for which a count is to be performed. If you do not supply this argument, counts are returned only for values present in Table Column. Use this argument to include rows in the returned table for values that are not always present in Table Column. If you specify this argument, the returned table includes a row for each specified value, even if the count for some values is 0.
  • Restrict to Value List: Numerical value (0 or 1) that determines whether a count is performed only for values in Value List. If Restrict to Value List is set to 0, all unique values from the Table Column are included in the returned table. If Restrict to Value List is set to 1 and Value List is specified, only rows from the Value List are included.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, then original column names are retained. If set to 0, columns are given generic names (for example, Subtotal1 and Total1). Generic column names are useful when the data attachment for the Table argument uses a substitution that causes the column names to change when the substitution changes.

This function returns a table.

Count Unique Values By Time

Returns a table that lists unique values and their counts from a specified table, sorted by a specified number of specified date part Intervals. The Table must contain a time column and a value column. The returned table contains an interval column, a column for each unique value, and counts for number of intervals specified or for all data in the Table if the Number of Intervals is 0.

Arguments

The function has the following arguments:

  • Table: Data table column whose values are to be counted.
  • Date Parts Per Interval: Number of date parts in each interval by which the counts are to be sorted.
  • Number Of Intervals: Number of intervals by which the counts are to be sorted.
  • Date Part: Text string that specifies the date unit to use. Enter s, m, h, d, w, M, q, or y, for seconds, minutes, hours, days, weeks, months, quarters, or years.
  • Date Format: Text string that specifies the format of the function result. Specify a pattern string suitable for use with the Java SimpleDateFormat class.
  • Value List: Table column that specifies values for which a count is to be performed. If you do not supply this argument, counts are returned only for values present in Table. Use this argument to include rows in the returned table for values that are not always present in Table. If you specify this argument, the returned table includes a row for each specified value, even if the count for some values is 0.
  • Restrict to Value List: Numerical value (0 or 1) that determines whether a count is performed only for values in Value List. If Restrict to Value List is set to 0, all unique values from the Table Column are included in the returned table. If Restrict to Value List is set to 1 and Value List is specified, only rows from the Value List are included.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names (for example, Subtotal1 and Total1). Generic column names are useful when the data attachment for the Table argument uses a substitution that causes the column names to change when the substitution changes.

This function returns a table.

Create Selector List

Returns a two column table containing selector names and their corresponding values to be presented in a dropdown list. The first column contains selector names and the second column contains their values. The returned table consists of the first two columns of a specified table, optionally modified by sorting, and with the optional addition of a row that contains a specified selector name in the first column and the value * in the second column. If the input table has only one column its contents are used for both the selector names and values.

Arguments

This function has the following arguments:

  • Selector Table: Table whose data is to be presented in a dropdown list.
  • All Selector Name: Text string that controls whether an initial row is added to the returned table that contains. If you specify a value, a row is added whose first column contains the specified value and whose second column contains the value *.
  • Sort Values: Numeric value that controls whether the returned rows are sorted. Set this argument to 1 in order to sort the returned rows by selector name. The sort is numerical, if all the selector names are numbers; otherwise the sort is alphabetical.
  • Sort Descending: Numeric value that controls whether returned rows are sorted in descending order, if the argument Sort Values is set to 1. Set Sort Descending to 1 in order to sort selector names in descending order. Set the argument to 0 (or leave it blank)) in order to sort selector names in ascending order.

This function returns a table.

Delta And Rate Rows

Returns a table that includes a rate-of-change column as well as a delta column for each specified data column. The function returns a table including, for the specified columns, new values for the difference between this update and the previous, along with the rate of change per second. The new values may be appended to the input table in columns named by prefixing Delta and Rate to the column name, or the delta columns may replace the corresponding input columns (the rate columns will still be appended to the table).

This function has the following arguments:

  • Table: Table of interest
  • Delta Column Names: Names of one or more columns for which deltas will be calculated. At least one name must be given.
  • Index Column Names: Names of one or more columns that uniquely identify a row in the table. If left blank, the default is to calculate deltas for all rows as if they had the same value. The values contained in each index column are concatenated to form a unique index used to organize the resulting summary data..
  • Time Column Name: Name of a timestamp column that will be used to calculate the rate of change. A name must be given. If the specified column is not found in the data it will be added, and its values will be taken from the current time on each update.
  • Replace Data With Deltas: If set to 1, the delta values replace the original values in the same column in the returned table; otherwise they are in new columns appended to the table.
  • Display Negative values: If set to 1, the delta values less than zero will be displayed with a negative sign and the value; otherwise they will be displayed as zero.

This function returns a table.

Delta Rows

Computes the delta between incoming rows of tabular data. This function returns a table that includes, for the specified columns, new values for the difference between the current update and the previous update.

Arguments

The function has the following arguments:

  • Table: Table for which
  • Delta Column Names: Text string that specifies the name of one or more columns for which deltas are to be calculated. Separate column names by a semicolon. This field cannot be left blank.
  • Index Column Names: Text string that specifies the name of one or more columns that uniquely identify a row in the table. Separate column names by a semicolon. If left blank, the function calculates deltas for all rows as if they had the same value. The values contained in each index column are concatenated to form a unique index that is used to organize the resulting summary data.
  • Replace Data With Deltas: Numerical value (0 or 1) that determines whether the returned table includes columns with the original values from Table. If set to 1, delta values replace original values in columns with the original names. If set to 0, new columns are added. The new columns use the original columns names with Delta prefixed.
  • Display Negative Values: If set to 1, delta values less than zero are displayed with a negative sign. If set to 0, delta values less than zero are displayed as zero.

This function returns a table.

Distinct Values

Returns a table with a single column that lists all unique values from a specified column of a specified table.

Arguments

This function has the following arguments:

  • Table: Table that contains the column whose unique values are to be returned.
  • Column Name: Name of the column whose unique values are to be returned.
  • Sort Values: Numeric value that controls whether the returned values are sorted. Set this to 1 in order to sort the values. Values are sorted in numerical order, if all values are numbers; otherwise they are sorted alphabetically.
  • Sort Descending: Numeric value that controls whether the returned values are sorted in descending order, if Sort Values is set to 1. Set Sort Descending to 1 in order to sort the values in descending order. Set the argument to 0 (or leave it blank) in order to sort the values in ascending order.
  • Use Column Name: Numeric value that controls the label of the returned column. Set this argument to 1 in order to use the original column name (the value of the Column Name argument). Set the argument to 0 (or leave it blank) in order to use the name Values. Use a generic name when you want a display that is independent of the value of Table, for example, because the value of Table uses a substitution that causes column names to change when the substitution changes.

This function returns a table.

Divide Columns

Returns a table that includes a column reflecting the quotient of specified columns of a specified table, the quotient of a specified value and a specified column, or the quotient of two specified values.

Usage notes
  • Case 1: Quotient of specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Quotient of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Quotient of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of dividing the corresponding row’s cell in First Column Name or Numeric Value by the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of dividing the corresponding row’s cell in the specified column by the specified numeric value.

In case 3, each cell of the returned column contains the quotient of the two specified numeric values.

In the returned table, the quotient column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be divided.
  • First Column Name or Numeric Value: Text string specifying the column to whose values are to be used as dividends, or numerical value to be as dividends.
  • Second Column Name or Numeric Value: Text string specifying the column to whose values are to be used as divisors, or numerical value to be as divisors.
  • Result Column Name: Text string that specifies the name of the column containing the quotients. You must supply a value for this argument.

This function returns a table.

Ensure Columns

Returns a copy of a specified table, modified where necessary to guarantee that given columns have specified types.

Arguments

The function has the following arguments:

  • Table: The specified table.
  • Column Name(s): Text string that specifies the columns to be modified if necessary. Supply a single column name or a semicolon-separated list of column names.
  • Column Type(s): Text string that specifies the types. Supply a single name or a semicolon-separated list of names. The nth element of Column Type(s) is the type to be guaranteed for the column specified by the nth element of Column Name(s).
  • Values: Semicolon-separated list of values to substitute when a value must be modified. The nth element of Values is used for the column named by the nth element of Column Name(s).

This function returns a table.

Ensure Timestamp Column

Returns a copy of a specified table, supplemented if necessary to include a timestamp column with a specified name. The added column is filled with the current time.

Arguments

The function has the following arguments:

  • Table: The specified table.
  • Column Name: Name to be used for the timestamp column, if one is added.
  • Append Column: If set to 1, the timestamp column is appended to the end of the table; otherwise it is inserted as the first column.

This function returns a table.

Evaluate Expression By Row

Returns the result of evaluating a specified expression for each row of a specified table. The specified expression contains variables, each of which has an associated column of the specified table.

Usage notes

The returned table has all the columns of the specified table, followed by a column that contains the evaluation results. The nth row of the results column contains the result evaluating the expression with values from the nth row of the specified table substituted for expression variables.

Boolean true and false values are returned as 1.0 and 0.0 respectively.

Arguments

The function has the following arguments:

  • Expression: Text string that specifies the expression to evaluate. Prefix variable names with %. Use standard arithmetic and logical operators. You can also use a variety of mathematical and string functions, as well as numeric and string constants. Enclose string constants in double quotes.
  • Table: The table whose data is to be substituted into the Expression for evaluation.
  • Result Column Name: Text string that specifies the name of the result column.
  • Result Column Type: Text string that specifies the type of values in the result column. Specify either double or string (or the abbreviations d or s).
  • Expression variable arguments: When the Expression field of the Edit Function dialog is activated (by pressing Enter or navigating to another field), the dialog displays a text field for each variable. For each field, enter a text string that names a column of Table. Column values are substituted for the corresponding variables in Expression. The types of the values are taken from the types of the columns. Numeric and boolean values are converted to double. Date columns are not supported.

If a value whose form is numeric needs to be treated as a string, for example to serve as an argument to a string function, surround the variable in Expression with double quotes. Variables enclosed in double quotes are always used as strings. An example of such an expression is length("%var1") + %var2.

This function returns a text string.

Example

The second table below is attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog

Illustration showing two tables

Filter And Extract Matches

Returns a table containing all rows from a specified table in which the value of a specified column matches a specified pattern. For each matching row, each token from the specified column that matches a group in the pattern is extracted to a new column.

Arguments

This function has the following arguments:

  • Table: Table from which matching rows are to be extracted.
  • Filter Column Name: Text string specifying the column of Table to be searched for matches.
  • Pattern: Text string that is either a simple string that optionally uses * as a wildcard, or a regular expression as described in the Java API documentation for java.util.regex.Pattern.
  • Pattern Is Reg Expr: Numerical value (0 or 1) that determines whether the pattern is interpreted as a simple string (that optionally uses * as a wildcard) or as a regular expression. If this argument is 0 (the default), Pattern is interpreted as a simple string. Otherwise, Pattern is interpreted as a regular expression.
  • Number of New Columns: Numerical value that specifies the number of new columns to be added to the result table to contain the matching groups extracted from the filter column.
  • New Column Names: Text string that specifies the name of each new column. Separate column names with a semicolon.

This function returns a table.

Example

Consider the following arguments:

  • Table: Table that includes a Customer Name column.
  • Filter Column Name: CustomerName.
  • Pattern: * *
  • Pattern Is Reg Expr: 0
  • Number of New Columns: 2
  • New Column Names: FirstName;LastName

In this case, if a row of Table contains Joe Smith in the CustomerName column, the corresponding row in the result table contains Joe in the FirstName column and Smith in the LastName column.

Filter By Pattern

Returns a table containing all rows from a specified table in which the value of a specified column matches a specified pattern.

Arguments

This function has the following arguments:

  • Table: Table from which matching rows are to be extracted.
  • Filter Column Name: Text string specifying the column of Table to be searched for matches.
  • Pattern: Text string that is either a simple string that optionally uses * as a wildcard, or a regular expression as described in the Java API documentation for java.util.regex.Pattern.
  • Pattern Is Reg Expr: Numerical value (0 or 1) that determines whether the pattern is interpreted as a simple string (that optionally uses * as a wildcard) or as a regular expression. If this argument is 0 (the default), Pattern is interpreted as a simple string. Otherwise, Pattern is interpreted as a regular expression.

This function returns a table.

Filter By Row

Returns a table containing all rows from a specified table in which the values of specified columns matches the values in specified lists of values.

Arguments

This function has the following arguments:

  • Table: Table from which matching rows are to be extracted.
  • Filter Column Name: Text string that specifies a list of column names, the columns of Table to be searched for matches. Separate column names with
  • Filter Value: Text string that specifies a list of lists of values to be matched. Separate values with a coma. Separate lists with a semicolon (for example, val1,val2;val3,val4;val5,val6). Enter * for Filter Value in order to display all rows in the table. To use * as a literal comparative value, enclose it in single quotes. To use ; as a literal comparative value, enclose it in single quotes. If a filter value contains a space or a semicolon, enclose the entire value in single quotes.

A row from Table is included in the returned table if and only if the nthFilter Column Name matches a value in FilterValue’s nth list, for all n from 1 to the number of specified column names.

This function returns a table.

Filter By Time Range

Returns a copy of a specified table that contains only those rows in which the value of a specified column falls within a specified time range.

Arguments

The function has the following arguments:

  • Table: Table whose rows are to be copied.
  • Date/Time Column Name: Text string that specifies a column of Table that contains a timestamp. If this argument is not supplied, the first column of Table is assumed to contain a timestamp.
  • Time Range Start: Text string that specifies the start of the desired time range. If this argument is not supplied, the time range is unbounded at the lower end.
  • Time Range End: Text string that specifies the end of the desired time range. The time range itself does not include this value, but does include a value that is one second less than Time Range End. If this argument is not supplied, the time range is unbounded at the upper end.

This function returns a table.

First Table Rows

Returns a table containing one of the following:

  • First n rows of a specified table, for a specified number, n.
  • First n rows for each unique combination of values in a specified set of columns in a specified table, for a specified number, n.
Arguments

This function has the following arguments:

  • Table: Table some of whose rows are to be returned.
  • Index Column Names: Text string that specifies the column or columns to be used to form indexes. Separate column names with a semicolon. If this argument is not supplied, the function returns the first Number of Rows of Table. If this argument is supplied, the function forms indexes by concatenating the values contained in each index column, and returns Number of Rows for each index.
  • Number of Rows: Numerical value that specifies the number rows to be returned, or the number of rows with each index value to be returned.

The function returns a table.

Format Table Columns

Returns a copy of a specified table with specified formats applied to specified columns.

Arguments

This function has the following arguments:

  • Table to Format: Table whose columns are to be formatted.
  • Column Format(s): Text string that specifies the columns to format and the formats to use. The string consists of column-name : column-format. Separate pairs with a semicolon. Separate column name from column format with a colon. Enclose a column name in single quotes if it contains a space.

Specify the column format based on the Java format specification, or with the following shorthand: $ for money values, $$ for money values with additional formatting, or () for non-money values, formatted similar to money. For example, if Column Format(s) contains the pair ‘Units Completed’:$, the Units Completed column in the returned table is formatted for money. Both positive and negative formats can be supplied, for example: #,###;(#,###).

The function accepts date/time patterns for formatting columns of type Date. For example consider a column Timestamp with the value Sep 06, 2008 7:27:36 AM. If it is formatted with ‘Timestamp’:‘MM/dd/yyyy’ the result is 09/06 /2008. If it is formatted with ‘Timestamp’:‘hh:mm:ss’ the result is 07:27:36. For the full list of formatting codes, see the Java documentation for the class SimpleDateFormat.

The function returns a table.

Get data server connection status

Returns a table that contains status information for the data server being used by the current dashboard.

Columns

The table has the following columns:

  • Name: __default for the default data server, or the name of a named data server
  • Connected: True if the server connection is operational; False otherwise
  • Status: OK if connection is operational, no connection if there is no connection to the server, or no service if there is an HTTP connection to the rtvdata servlet but the servlet has no connection to its data server
  • ConnectionString: URL for an HTTP connection to the rtvdata servlet or hostname:port for a direct socket connection to a data server
  • ReceiveCount: Number of data transmissions (pushes) received from the server
  • ReceiveTime: Time of the most recent data transmission from the server
  • Config: String that identifies data server version
Arguments

The function has no arguments.

This function returns a table.

Group By Time

Returns a table that contains a summary of all the data in a given table, aggregated over time. The summary data in the returned table is grouped into a specified number of specified time intervals over a specified time range.

Arguments

The function has the following arguments:

  • Table: Table whose data is to be summarized.
  • Group Type: Text string that specifies the type of aggregation to perform. Enter one or more of the following: sum, count, average, min, max. The default is sum. For multiple group types, use a semicolon-separated list and set Use Column Names to 0.
  • Date/Time Column Name: Text string that specifies a column of Table that contains a timestamp. If this argument is not supplied, the first column of Table is assumed to contain a timestamp.
  • Date Part: Text string that specifies the date unit to use. Enter s, m, h, d, w, M, q, or y, for seconds, minutes, hours, days, weeks, months, quarters, or years. The default unit is seconds.
  • Date Parts Per Interval: Numerical value that specifies he size of each interval in Date Parts.
  • Number Of Intervals: Numerical value that specifies the number of intervals to include in the summary table. The returned table contains one row for each interval. If set to 0, the number of intervals is determined from the range of data in Table, or by the specified time range.
  • Time Range Start: Text string that specifies the start of the desired time range. If this argument is not supplied, the time range is unbounded at the lower end.
  • Time Range End: Text string that specifies the end of the desired time range. The time range itself does not include this value, but does include a value that is one second less than Time Range End. If this argument is not supplied, the time range is unbounded at the upper end.
  • Restrict To Time Range: Numerical value (0 or 1) that determines whether Time Range Start and Time Range End are ignored. If set to 1, the resulting summary table includes only those time intervals within the specified range. If set to 0, the specified time range is ignored.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names. Set this to 0 if you specify multiple groups types.

This function returns a table.

Group By Time and Unique Values

Returns a table that contains a summary of all the data in a given table, aggregated over both time and index columns. The summary data in the returned table is grouped into specified time intervals, with a further breakdown by unique values in specified index columns.

Arguments

The function has the following arguments:

  • Table: Table whose data is to be summarized.
  • Group Type: Text string that specifies the type of aggregation to perform. Enter one or more of the following: sum, count, average, min, max. The default is sum. For multiple group types, use a semicolon-separated list and set Use Column Names to 0. The default is sum.
  • Date/Time Column Name: Text string that specifies a column of Table that contains a timestamp. If this argument is not supplied, the first column of Table is assumed to contain a timestamp.
  • Date Part: Text string that specifies the date unit to use. Enter s, m, h, d, w, M, q, or y, for seconds, minutes, hours, days, weeks, months, quarters, or years. The default unit is seconds.
  • Date Parts Per Interval: Numerical value that specifies he size of each interval in Date Parts.
  • Number Of Intervals: Numerical value that specifies the number of intervals to include in the summary table. The returned table contains one row for each interval. If set to 0, the number of intervals is determined from the range of data in Table, or by the specified time range.
  • Time Range Start: Text string that specifies the start of the desired time range. If this argument is not supplied, the time range is unbounded at the lower end.
  • Time Range End: Text string that specifies the end of the desired time range. The time range itself does not include this value, but does include a value that is one second less than Time Range End. If this argument is not supplied, the time range is unbounded at the upper end.
  • Restrict To Time Range: Numerical value (0 or 1) that determines whether Time Range Start and Time Range End are ignored. If set to 1, the resulting summary table includes only those time intervals within the specified range. If set to 0, the specified time range is ignored.
  • Index Column Names: Text string that specifies the column or columns to be used to form indexes. Separate column names with a semicolon. If this argument is not supplied, the function aggregates only by time interval. If this argument is supplied, the function forms indexes by concatenating the values contained in each index column, and aggregates by index value within time-interval aggregations.
  • Value List: Table column that contains a set of values to be included in the set of values for the first index column. This is useful if you want the summary table to include values that may or may not be in the Table data.
  • Restrict To Value List: Numerical value (0 or 1) that determines whether the table includes only rows that include the values of Value List. If set to 1, only such values are included.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names. Set this to 0 if multiple group types are specified.
  • Restrict To Data Combinations: Numerical value (0 or 1) that determines whether the returned table is restricted to only those combinations of values found in the specified index columns that occur in the data. If set to 0, the returned table contains all possible combinations of unique values found in the specified index columns.

This function returns a table.

Group by Unique Values

Returns a table that contains a summary of all the data in a given table. The summary data in the returned table is grouped by unique values in specified index columns.

Arguments

The function has the following arguments:

  • Table: Table whose data is to be summarized.
  • Group Type: Text string that specifies the type of aggregation to perform. Enter one or more of the following: sum, count, average, min, max. The default is sum. For multiple group types, use a semicolon-separated list and set Use Column Names to 0..
  • Index Column Names: Text string that specifies the column or columns to be used to form indexes. Separate column names with a semicolon. If this argument is not supplied, the function uses the first column of Table as the index column. If this argument is supplied, the function forms indexes by concatenating the values contained in each index column, and aggregates by index value.
  • Value List: Table column that contains a set of values to be included in the set of values for the first index column. This is useful if you want the summary table to include values that may or may not be in the Table data.
  • Restrict To Value List: Numerical value (0 or 1) that determines whether the table includes only rows that include the values of Value List. If set to 1, only such values are included.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names.
  • Restrict To Data Combinations: Numerical value (0 or 1) that determines whether the returned table is restricted to only those combinations of values found in the specified index columns that occur in the data. If set to 0, the returned table contains all possible combinations of unique values found in the specified index columns. Set this to 0 if multiple group types are specified.

This function returns a table.

Example 1 - Group By Unique Values

The pie graph and the second table below are attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog for the first example

Illustration showing the table for the first example

Example 2 - Group By Unique Values

The bar graph and the second table below are attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog for the second example

Illustration showing the table for the second example

Illustration showing a bar graph

Join

Returns the result of performing an inner join of two specified tables on specified columns. The result contains all columns from Left Table followed by all columns from Right Table, and contains all rows for which the value in Left Column exactly matches the value in Right Column. Left Column Name and Right Column Name can each specify a semicolon-separated list of n column names, in which case a match occurs if the ith value in Left Column Name exactly matches the ith value in Right Column Name, for all i between 1 and n, inclusive.

Arguments

The function has the following arguments:

  • Left Table: Table on which the join is to be performed.
  • Right Table: Table on which the join is to be performed.
  • Left Column Name: Text string that specifies the column or columns from Left Table on which the join is to be performed. If left blank, the row name, up to the first colon (if it contains a colon), is used instead of a column value.
  • Right Column Name: Text string that specifies the column or columns from Right Table on which the join is to be performed. If left blank, the row name, up to the first colon (if it contains a colon), is used instead of a column value.

This function returns a table.

Example

The third table below is attached to the function defined by the following dialog. The first table’s data table is attached to the argument Left Table and the second table’s data table is attached to the argument Right Table.

Illustration showing the Edit Function dialog

Illustration showing the tables

Join Outer

Performs an outer join of the Left Table and the Right Table on the columns specified in the Left Column Name and the Right Column Name fields. The joined table contains all columns from the Left Table followed by all columns from the Right Table, and contains all rows where the value in the Left Column exactly matches the value in the Right Column, plus additional rows according to the Outer Join Type, which may be left, right, or full.

Usage notes

In a left outer join, the result table includes all the rows from the left table; in a right outer join it includes all the rows from the right table, and in a full outer join it includes all the rows from both tables. In any row where there is no match for the join column value, the cells from the other table contain null values. (Null values are represented as blank for strings, 0 for integers and longs, NaN for floats and doubles, and NULL_DATE for dates.)

Left Column Name and Right Column Name can each specify a semicolon-separated list of n column names, in which case a match occurs if the ith value in Left Column Name exactly matches the ith value in Right Column Name, for all i between 1 and n, inclusive.

For a full join or right join, if the Left Table is null, the result is Right Table. For a full join or left join, if Right Table is null, the result is Left Table. In all other cases the result is null.

Arguments

The function has the following fields:

  • Left Table: The first table to be joined.
  • Right Table: The second table to be joined.
  • Left Column Name: (Optional) The column or columns in the left table to be joined with the column or columns specified in the Right Column Name field. If this field is left blank, the row name, up to the first : if it contains a :, is used instead of a column value.
  • Right Column Name: (Optional) The column or columns in the right table to be joined with the column or columns specified in the Left Column Name field. If this field is left blank, the row name, up to the first : if it contains a :, is used instead of a column value.
  • Outer Join Type: Specified as left, right, or full, which may be abbreviated to their first letters. If this field is left blank a full outer join is performed.

This function returns a table.

Last Table Rows

Returns a table containing one of the following:

  • Last n rows of a specified table, for a specified number, n.
  • Last n rows for each unique combination of values in a specified set of columns in a specified table, for a specified number, n.
Arguments

This function has the following arguments:

  • Table: Table some of whose rows are to be returned.
  • Index Column Names: Text string that specifies the column or columns to be used to form indexes. Separate column names with a semicolon. If this argument is not supplied, the function returns the last Number of Rows of Table. If this argument is supplied, the function forms indexes by concatenating the values contained in each index column, and returns Number of Rows rows for each index.
  • Number of Rows: Numerical value that specifies the number rows to be returned, or the number of rows with each index value to be returned.

The function returns a table.

Mark Time Gaps

Returns a table that results from supplementing a given trend table with special rows that indicate longer-than-expected time intervals between timestamps of adjacent rows of the given trend table. For a trend graph attached to the returned table, the trend line will contain a break (or a specified character) wherever time gaps occurred.

Usage Notes

The table is constructed as follows: If the time interval between any two rows in the table is greater than the expected interval, insert 2 new rows between those rows in which the value of each column to be marked is set to NaN or other specified value. (NaN indicates “not a number”. A trend graph will break a trace line when a NaN is encountered). The timestamp of the first new row is set to a value of 1 msec more than the timestamp of the last row before the graph and the timestamp of the second new row is set to a value of 1 msec less than the timestamp of the next row after the gap. It is assumed that the table is sorted by timestamp in ascending order. On the second and subsequent updates of this function, the timestamp of the first row in the table is compared to the timestamp of the last row from the previous update.

Arguments

This function has the following arguments:

  • Table: Table to be checked for time gaps. The table must have a timestamp column and must be sorted by timestamp in ascending order.
  • Name of Timestamp Column: Name of the table’s timestamp column
  • Expected Interval: The maximum time interval that should occur between consecutive rows in the table. If this interval is exceeded, it is considered a gap. Specify the interval in seconds or specify a value followed by m, h, d, for minutes, hours, or days.
  • Names of Columns to Mark: Names of the columns to be marked with the specified value when rows are added to mark a gap. Separate multiple column names with semicolons. If no column names are specified then all columns with floating point values will be marked.
  • Mark Columns Width: The value to be assigned when marking columns in the rows added to mark a gap. The default is NaN, but any numeric value can be used.

The function returns a table.

Max All Rows or Columns

Determines the maximum cell value for each row or column of the specified Table.

Usage notes

If Return Column is 1, the function returns a table with one column. The nth cell of the returned column contains the maximum of the numerical cells in the nth row of the table specified by the argument Table. (If there are no numerical cells in the row, the returned cell contains 0.)

If Return Column is 0, the function returns a table with one row. The nth cell of the returned row contains the maximum of the numerical cells in the nth column of the table specified by the argument Table. (If there are no numerical cells in the column, the returned cell contains N/A, by default—but see the argument Result Label Column, below.) The nth column of the returned one-row table is labeled with the label of the nth column of the table specified by the argument Table.

Arguments

This function has the following arguments:

  • Table: Table for which row or column maximums are to be determined.
  • Return Column: Numeric value that controls whether to return a column or a row of result values. To get a column of result values, one value for each row, set Return Column to 1. To get a row of result values, one value for each column, set Return Column to 0.
  • Result Label: Text string that specifies a label for the result row or column. If not specified, the label text is Maximum. If Return Column is 0, the label appears only if Result Label Column is set to a column of Table that has no numeric values. If Return Column is 1, the label text always appears and Result Label Column is ignored.
  • Result Label Column: Text string that specifies the column in which Result Label appears, if Return Column is 0. The specified column must have no numeric values in order for the label to appear. If Return Column is 1, this argument is ignored.

This function returns a table.

Max Columns

Returns a table that includes a column reflecting the larger of two specified columns of a specified table, the larger of a specified value and a specified column, or the larger of two specified values.

Usage notes
  • Case 1: Larger of two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Larger of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Larger of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the larger of the corresponding row’s cell in First Column Name or Numeric Value and the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the larger of the corresponding row’s cell in the specified column and the specified numeric value.

In case 3, each cell of the returned column contains the larger of the two specified numeric values.

In the returned table, the column that reflects the larger value is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be compared.
  • First Column Name or Numeric Value: Text string specifying the first column to be compared, or numerical value to be compared.
  • Second Column Name or Numeric Value: Text string specifying the second column to be compared, or numerical value to be compared.
  • Result Column Name: Text string that specifies the name of the column containing the maximums. You must supply a value for this argument.

This function returns a table.

Min All Rows or Columns

Determines the minimum cell value for each row or column of the specified Table.

Usage notes

If Return Column is 1, the function returns a table with one column. The nth cell of the returned column contains the minimum of the numerical cells in the nth row of the table specified by the argument Table. (If there are no numerical cells in the row, the returned cell contains 0.)

If Return Column is 0, the function returns a table with one row. The nth cell of the returned row contains the minimum of the numerical cells in the nth column of the table specified by the argument Table. (If there are no numerical cells in the column, the returned cell contains N/A, by default—but see the argument Result Label Column, below.) The nth column of the returned one-row table is labeled with the label of the nth column of the table specified by the argument Table.

Arguments

This function has the following arguments:

  • Table: Table for which row or column minimums are to be determined.
  • Return Column: Numeric value that controls whether to return a column or a row of result values. To get a column of result values, one value for each row, set Return Column to 1. To get a row of result values, one value for each column, set Return Column to 0.
  • Result Label: Text string that specifies a label for the result row or column. If not specified, the label text is Minimum. If Return Column is 0, the label appears only if Result Label Column is set to a column of Table that has no numeric values. If Return Column is 1, the label text always appears and Result Label Column is ignored.
  • Result Label Column: Text string that specifies the column in which Result Label appears, if Return Column is 0. The specified column must have no numeric values in order for the label to appear. If Return Column is 1, this argument is ignored.

This function returns a table.

Min Columns

Returns a table that includes a column reflecting one of the smaller of two specified columns of a specified table, the smaller of a specified value and a specified column, or the smaller of two specified values.

Usage notes
  • Case 1: Smaller of two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Smaller of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Smaller of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the smaller of the corresponding row’s cell in First Column Name or Numeric Value and the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the smaller of the corresponding row’s cell in the specified column and the specified numeric value.

In case 3, each cell of the returned column contains the smaller of the two specified numeric values.

In the returned table, the column that reflects the smaller value is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be compared.
  • First Column Name or Numeric Value: Text string specifying the first column to be compared, or numerical value to be compared.
  • Second Column Name or Numeric Value: Text string specifying the second column to be compared, or numerical value to be compared.
  • Result Column Name: Text string that specifies the name of the column containing the minimums. You must supply a value for this argument.

This function returns a table.

Modulo Columns

Returns a table that includes a column reflecting the remainder of division performed on specified columns of a specified table, the remainder of division performed on a specified value and a specified column, or the remainder of division performed on two specified values.

Usage notes
  • Case 1: Remainder of division performed on specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Remainder of division performed on a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Remainder of division performed on two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the remainder of dividing the corresponding row’s cell in First Column Name or Numeric Value by the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the remainder of dividing the corresponding row’s cell in the specified column by the specified numeric value.

In case 3, each cell of the returned column contains the remainder of dividing the first value by the second.

In the returned table, the remainder column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be divided.
  • First Column Name or Numeric Value: Text string specifying the column to whose values are to be used as dividends, or numerical value to be as dividends.
  • Second Column Name or Numeric Value: Text string specifying the column to whose values are to be used as divisors, or numerical value to be as divisors.
  • Result Column Name: Text string that specifies the name of the column containing the remainders. You must supply a value for this argument.

This function returns a table.

Multiply Columns

Returns a table that includes a column reflecting the product of two specified columns of a specified table, the product of a specified value and a specified column, or the product of two specified values.

Usage notes
  • Case 1: Product of two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Product of a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Product of two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of multiplying the corresponding row’s cell in First Column Name or Numeric Value by the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of multiplying the corresponding row’s cell in the specified column by the specified numeric value.

In case 3, each cell of the returned column contains the product of the two specified numeric values.

In the returned table, the product column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be summed.
  • First Column Name or Numeric Value: Text string specifying the first column to be included in the product, or numerical value to be included in the product.
  • Second Column Name or Numeric Value: Text string specifying the second column to be included in the product, or numerical value to be included in the product.
  • Result Column Name: Text string that specifies the name of the column containing the products. You must supply a value for this argument.

This function returns a table.

Percent Columns

Returns a table that includes a column reflecting the quotient of specified columns of a specified table, the quotient of a specified value and a specified column, or the quotient of two specified values. Values are expressed as percentages.

Usage notes
  • Case 1: Quotient of specified columns of a specified table, expressed as a percentage. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Quotient of a specified value and a specified column, expressed as a percentage. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Quotient of two specified values, expressed as a percentage. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result, expressed as a percentage, of dividing the corresponding row’s cell in First Column Name or Numeric Value by the cell in Second Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result, expressed as a percentage, of dividing the corresponding row’s cell in the specified column by the specified numeric value.

In case 3, each cell of the returned column contains the quotient, expressed as a percentage, of the two specified numeric values.

In the returned table, the percent column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be divided.
  • First Column Name or Numeric Value: Text string specifying the column to whose values are to be used as dividends, or numerical value to be as dividends.
  • Second Column Name or Numeric Value: Text string specifying the column to whose values are to be used as divisors, or numerical value to be as divisors.
  • Result Column Name: Text string that specifies the name of the column containing the percentages. You must supply a value for this argument.

This function returns a table.

Pivot On Unique Values

Returns a table in which row data from a specified table is rotated into columns.

Arguments

The function has the following arguments:

  • Pivot Name Column: Text string that specifies the column containing values that become new column names in the returned table.
  • Key Column: Text string that specifies the column used to group rows containing unique names in Pivot Name Column into a single row.
  • Pivot Value Column: Text string that specifies the column containing the data of interest. All consecutive rows that contain the same value in Key Column have the data in the Pivot Value Column subtotaled into the same row of the resulting table, in the appropriate column.
  • Name List: Text string that specifies values for which columns should be included in the returned table. To include columns in the returned table for names that are not present in Pivot Name Column, specify a semicolon-separated list of names.
  • Restrict to Name List: Numerical value that determines whether the returned table contains columns only for items in Name List. If set to 0 or if Name List is not specified, all unique values from Pivot Name Column are included in the returned table; otherwise only values from the Name List are included.

This function returns a table.

Example

The bar chart and the second table (labeled Pivot Customer), below, are attached to the function defined by the following dialog. The first table’s data table is attached to the argument Table.

Illustration showing the Edit Function dialog

Illustration showing a table

Illustration showing a bar graph

Reference

Returns a reference to the specified table without copying the contents.

Arguments

The function has the following argument:

  • Table: The table for which a reference is to be returned.

This function returns a table.

Rename Columns

Returns a copy of a specified table with specified columns renamed with specified new names.

Arguments

The function has the following arguments:

  • Table: The table whose columns are to be renamed.
  • Column Name(s): Text string that specifies the columns to be renamed. Supply a single column name or a semicolon-separated list of column names.
  • New Name(s): Text string that specifies the new column names. Supply a single name or a semicolon-separated list of names. The nth element of New Name(s) is the new name of the column specified by the nth element of Column Name(s). The number of names in Column Name(s) must be less than or equal to the number of names in New Name(s).

This function returns a table.

Select Column

Returns a one-column table containing only a specified column from a specified table.

Arguments

The function has the following arguments:

  • Table: Table from which the column is to be selected.
  • Select Column Name: Text string that specifies the name of the column to select.

This function returns a table.

Set Column Type

Returns a copy of a specified table, with specified columns modified to use specified types.

Arguments

The function has the following arguments:

  • Table: Table from which the column is to be selected.

  • Column Types: Text string that specifies column-name/type pairs. Separate pairs with spaces. Within each pair, separate column-name from type with a colon, that is, each pair has the following form:

    column-name:type

    For type, supply one of the following:

    • STRING
    • INTEGER
    • LONG
    • DOUBLE
    • FLOAT
    • BOOLEAN
    • DATE If column-name contains a space or a colon, it must be enclosed in single quotes. Here is an example:

    apama.timestamp:DATE ‘Max Value’:INTEGER Active:BOOLEAN

This function returns a table.

Sort Table

Returns a table with the same rows as a specified table but with the rows sorted according to the values in a specified column or columns.

If you specify multiple columns, the returned table is sorted on the first column specified, and then on the second column, and so forth.

Arguments

This function has the following arguments:

  • Table: Table to sort.
  • Sort Column Name: Text string that specifies the column or columns whose values determine the sort order. Separate column names with a semicolon. If the columns contain text, the sort order is alphabetic, unless the text consists entirely of numbers, in which case the sort order is numeric.
  • Sort Descending: Numerical value (0 or 1) that determines whether the sort order is ascending or descending. If set to 1, the sort order is descending; otherwise, the sort order is ascending.
Info
If an invalid column name is entered, the original table is returned.

This function returns a table.

Split String

Returns a table with the result of splitting a given string using a specified separator. The returned table contains one column, with a row for each resulting substring.

Arguments

The function has the following arguments:

  • String: Text string to be split.
  • Separator: Text string consisting of a regular expression that specifies the separator. Use the regular expression form suitable for use with the Java Pattern class. See the Java API documentation for java.util.regex.Pattern.
  • Results Column Name: Text string that specifies the name of the returned column.

This function returns a table.

String to Table

Returns a table whose cell values are specified by a string that uses specified row and column delimiters.

Arguments

The function has the following arguments:

  • String: Text string to be converted into a table.

  • Row Delimiter: Text string that specifies the delimiter by which the data for one row is separated (in String) from the data for the next row.

    Note, if you specify a delimiter that consists of more than one character, those characters are treated as a sequence of delimiters and a new row is created when any one of them is encountered.

  • Column Delimiter: Text string that specifies the delimiter by which the data for one cell in a row is separated (in String) from the data for the next cell in that row. If the table is to contain only one column, do not specify a value for Column Delimiter.

    Note, if you specify a delimiter that consists of more than one character, those characters are treated as a sequence of delimiters and a new column is created when any one of them is encountered.

  • Column Name Mode: Text string that specifies how the function should determine column names for the returned table. Specify one of the following:

    • AUTO: Use the generated names col0, col1, col2, and so forth.
    • STATIC: Use the names specified in Column Names.
    • STRING: Use the values specified in the first row of String. AUTO is the default setting; leaving this unset or set to a value other than AUTO, STATIC, or STRING defaults to AUTO.
  • Column Names: Text string that specifies the column names to use in the returned table, if Column Name Mode is Static.

  • Allow Empty Rows/Columns: Specifies whether or not empty cells will be created when empty tokens in the string are encountered. Setting this argument to “true” or “1” means empty cells will be created. For example, in a string that uses “,” (comma) as a delimiter, a row represented by 1,,,4 will result in a row with 1 in the first column followed by two empty cells, followed by 4. Setting this to “false”, “0”, or leaving it unset (the default) means that empty tokens will be ignored. In this case the “1,,,4” example will create a row with 1 in the first column, followed by 4 in the second column, followed by two blank columns.

This function returns a table.

Subtotal By Time

Returns a table that contains subtotals for the data in a given table. Subtotals are provided for a specified number of specified time intervals.

Arguments

The function has the following arguments:

  • Table: Table for which subtotals are to be provided. The Table must contain a time column and a number column.
  • Date Parts Per Interval: Numerical value that specifies he size of each interval in Date Parts.
  • Number Of Intervals: Numerical value that specifies the number of intervals to include in the summary table. The returned table contains one row for each interval. If set to 0, one subtotal row is provided for the entire table.
  • Date Part: Text string that specifies the date unit to use. Enter s, m, h, d, w, M, q, or y, for seconds, minutes, hours, days, weeks, months, quarters, or years. The default unit is seconds.
  • Date Format: Text string that specifies the format of times in the returned table. Specify a pattern string suitable for use with the Java SimpleDateFormat class. For example, the format EEE, hh:mm a results in a string of the form exemplified by Wed, 05:32 PM. Use q, qqq or qqqq for short, medium or long versions of quarter notation. For example, qqq-yyyy results in a string of the form exemplified by Qtr 1-2005. If no Date Format is given, dates are expressed in the form exemplified by 08/30/03 05:32 PM. If no Date Format is given, the type of the first column in the returned table is Date; otherwise it is String.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names. Generic column names are useful when the data attachment for the Table argument uses a substitution that causes the column names to change when the substitution changes.

This function returns a table.

Subtotal By Unique Values

Returns a table that lists all of the unique values found in the first column of a specified table, along with the sum of the values in the corresponding fields of the remaining columns.

Arguments

The function has the following arguments:

  • Table Columns: Table for which subtotals are to be provided. The function uses the first column of Table Columns as the index column. Subtotals are provided for the remaining columns of Table Columns.
  • Value List: Table column that contains a set of values to be included in the set of values for the index column. This is useful if you want the returned table to include values that may or may not be in the Table Columns index column.
  • Restrict To Value List: Numerical value (0 or 1) that determines whether the table includes only rows that include the values of Value List. If set to 1, only such values are included.
  • Use Column Names: Numerical value (0 or 1) that determines whether original column names are retained in the returned table. If Use Column Names is set to 1, original column names are retained. If set to 0, columns are given generic names. Generic column names are useful when the data attachment for the Table argument uses a substitution that causes the column names to change when the substitution changes.

This function returns a table.

Subtract Columns

Returns a table that includes a column reflecting the difference between two specified columns of a specified table, the difference between a specified value and a specified column, or the difference between two specified values.

Usage notes
  • Case 1: Difference between two specified columns of a specified table. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a column of Table.
  • Case 2: Difference between a specified value and a specified column. This is the case if one of First Column Name or Numeric Value and Second Column Name or Numeric Value specifies a column of Table and the other specifies a numeric value.
  • Case 3: Difference between two specified values. This is the case if First Column Name or Numeric Value and Second Column Name or Numeric Value both specify a numeric value.

In case 1, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of subtracting the corresponding row’s cell in Second Column Name or Numeric Value from the cell in First Column Name or Numeric Value.

In case 2, the nth cell in the returned column corresponds to the nth cell of the table specified by the argument Table. Each cell of the returned column contains the result of subtracting the specified numeric value from the corresponding row’s cell in the specified column.

In case 3, each cell of the returned column contains the subtracting the second specified value from the first.

In the returned table, the sum column is preceded by copies of all the columns in Table.

Arguments

The function has the following arguments:

  • Table: Table that contains the columns to be used in the subtraction operations.
  • First Column Name or Numeric Value: Text string specifying minuend, the column to be subtracted from, or numerical value to be subtracted from.
  • Second Column Name or Numeric Value: Text string specifying subtrahend, the column to be subtracted, or numerical value to be subtracted.
  • Result Column Name: Text string that specifies the name of the column containing the differences. You must supply a value for this argument.

This function returns a table.

Table Contains Values

Returns a copy of the specified Table with a new boolean column containing a value of true for each row where the value in the Comparison Column is contained in the one and only column of the Comparison Table.

This function has the following arguments:

  • Table: Table to be supplemented with the new boolean-valued column of comparison results.
  • Comparison Column Name: Name of the column in Table whose values are searched for in Comparison Table
  • Result Column Name: Name of the boolean result column to add to Table. If no name is specified, the column is named Result.
  • Comparison Table: Single-column table in which to look for values from Comparison Column of Table

This function returns a table.