Add/Edit Functions

It is possible to perform calculations on your data before it displayed in RTView. For example, you can create a function that will take the average value of a table column or add the values of multiple data attachments. To display the results, attach your functions to objects using the “Attach to Function Data” dialog.

Note: Functions are only available for use within the display where they are created. The file functions.rtv (located in the tutorials directory) is provided as an example of the different ways that functions can be utilized in a display.

Adding Functions

In the Display Builder, select Tools>Functions to open the Functions window.

function.gif

 

Field Name

Description

Functions

the functions listed can be sorted by clicking on any column name.

 

Name -- Function Name as entered in the Edit Function dialog.

Uses -- Number of times function is used in current display.

Local -- Selected if function is defined in current display.

Public -- Selected if function is available in display (.rtv) files, other than display where it was defined.

Source -- Name of file in which global function or included display file is defined.

Description -- Description as entered in the Edit Function dialog.

Add

To add a new function, click Add to open the Edit Function dialog. See “Editing Functions” for more information.

Copy

Select a function from the list and click Copy to create a duplicate of that function. To copy a function from your current display to another display (.rtv) file, select a function from the list and click the Copy button copy_button.gif in the toolbar (or Ctrl-C). Then open the other display (.rtv) file and click the Paste paste_button.gif button (or Ctrl-V). You must enter a unique name for each copy you make. If a function by that name already exists in that display (.rtv) file, you will need to rename the function.

Note: A function pasted into another display (.rtv) file will have the same data attachments as the original function.

Edit

Select a function from the list and click Edit to open the Edit Function dialog. See “Editing Functions” for more information.

Note: Functions associated with global functions or included display files can only be modified from the display in which they were originally defined.

Remove

Select a function from the list and click Remove to delete.

Result

Select a function from the list and click Result to view the result of executing the selected function.

References

Select a function from the list and click References to view a list of items that reference the selected function.

Make a selection from the References list to bring up dialogs and/or object properties associated with that reference item. If the selected reference item is an object, then that object will be highlighted in the Working Area.

If the selected item is another function and that function has references, then the References dialog will add an additional page of items referenced by that function. Use the << >> buttons to navigate between the references of interrelated functions.

If the References button is disabled, then the selected function is not referenced by any other items.

Editing Functions

function_edit.gif

 

Edit Functions Window

Field Name

Description

Function Name

Enter a unique name for your function. Each function must have a unique name (within that display). Function Names cannot contain spaces and the name function is not allowed.

Note: If a global function shares the same name as a local function, only the local function will be displayed and the global function will be ignored.

Public

If the Function Name specified will be defined as a global function or in an included display file, then selecting the Public check box will make this function available in all displays.

When the Public check box is deselected, this function will only be available for data attachments in the display (.rtv) file where it was defined. It is recommended that you deselect the Public check box if the function you defined may generate intermediary results that are only useful in the context of the current display and would be confusing or unusable during the creation of other displays. See “Global Functions and Variables” and “Include Display Files” for more information.

Function Type

The Function Type drop down menu lists all available calculations. Function types are divided into two groups: Scalar and Tabular. RTView comes with an array of built-in, pre-defined functions or you can create your own Custom Functions. See “Function Types” and “Custom Functions” for more information.

Arguments

Argument fields populate based on the selected Function Type. You may either enter a value into the Argument field or right-click and select Attach to Data to choose a data source. An argument that has been attached to data is displayed in green, this indicates that editing is no longer possible in the Argument field. Double-click in the Argument field to edit the data attachment.

Once an argument is attached to data, right-click to choose from the following options:

Attach to Data -- Change the data source.   

Detach from Data -- Remove the data attachment.

Display Data -- Open a window that contains a table showing data available from that attachment. Note: Only one Display Data window can be opened for each data attachment.   

Show Column Types -- Display the data type of each column.

Insert New Rows -- Insert new rows to display incoming data, By default, old data is replaced by new data on each update.

Edit Function -- If the argument references another function (i.e. is attached to Function data), you can edit the properties of the attached function. The current Edit Function dialog will be replaced with that of the attached function. Click the Back button to return to the function you were previously editing. Note: Save changes in your current Edit Function dialog before attempting to open another.

Description

Enter a description of any length, which will be visible in the Functions dialog as well as the “Attach to Function Data” dialog. This field is optional.

Function Types

Functions are separated into two groups according to whether they act on Scalar or Tabular data.

Scalar Functions

Add

Adds the two arguments.

Return Type 

Numeric

Arguments 

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Average

Calculates average of the two arguments.

Return Type 

Numeric

Arguments 

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Concatenate

Combines the two Values into a single text string.

Return Type

Text

Arguments 

Value1 (type = Numeric or Text)

Value2 (type = Numeric or Text)

Date Add

Adds the specified Number of Date Part intervals, which may be negative, to the specified Date and returns a string representing the resulting date/time. The Date must be either a formatted date/time string or a Java standard date/time argument in milliseconds from Jan 1, 1970. For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters or years. The Date Format specified is the same as the Java SimpleDateFormat class.  For example, the format MMMM dd, yyyy hh:mm:ss a would result in the form August 30, 2003 05:32:12 PM. If no Date Format is given, the string is returned in the form 08/30/03 05:32 PM. Use q, qqq, or qqqq for short, medium or long versions of quarter notation. For example, qqq-yyyy will result in a string of the form Qtr 1-2005. This function returns a text string.

Return Type

Text

Arguments

Date (type = Text (Java standard Date/Time argument in milliseconds))

Number (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Date Ceiling

Determines which Date Part interval contains the Date, and returns a string representing the start value of the next Date Part interval. The Date must be either a formatted date/time string or a Java standard date/time argument in milliseconds from Jan 1, 1970. For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters, or years. The Date Format specified is the same as the Java SimpleDateFormat class.  For example, the format MMMM dd, yyyy hh:mm:ss a would result in the form August 30, 2003 05:00:00 PM. If no Date Format is given, the string is returned in the form 08/30/03 05:00 PM. Use q, qqq or qqqq for short, medium or long versions of quarter notation. For example, qqq-yyyy will result in a string of the form Qtr 1-2005. This function returns a text string.

Return Type

Text

Arguments

Date (type = Text (Java standard Date/Time argument in milliseconds))

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Date Compare

Compares Date 1 and Date 2 and returns -1 if Date 1 is less than Date 2, 0 if the values are equal and 1 if Date 1 is greater than Date 2. Date 1 and Date 2 must be either formatted date/time strings or Java standard date/time arguments in milliseconds from Jan 1, 1970. For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters or years. Date Part controls the resolution of the comparison. For example, comparing 08/30/03 05:32 PM to 08/30/03 04:47 PM with Date Part set to m will return 1, while setting Date Part to d will cause this function to return 0. This function returns a number.

Return Type

Numeric

Arguments

Date 1 (type = Text (Java standard Date/Time argument in milliseconds))

Date 2 (type = Text (Java standard Date/Time argument in milliseconds))

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Difference

Calculates the integer number of Date Part intervals by which Date 1 is less than Date 2. Date 1 and Date 2 must be either formatted date/time strings or Java standard date/time arguments in milliseconds from Jan 1, 1970. For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters or years. For example, comparing 05/12/05 05:32 PM to 05/15/05 04:47 PM with Date Part set to d will return 3, This function returns a number.

Return Type

Numeric

Arguments

Date 1 (type = Text (Java standard Date/Time argument in milliseconds))

Date 2 (type = Text (Java standard Date/Time argument in milliseconds))

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Floor

Determines which Date Part interval contains the Date, and returns a string representing the starting date/time value of that interval. The Date must either be a formatted date/time string or a Java standard date/time argument in milliseconds from Jan 1, 1970, For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters or years. The Date Format specified is the same as the Java SimpleDateFormat class. For example, the format MMMM dd, yyyy hh:mm:ss a would result in the form August 30, 2003 05:00:00 PM. If no Date Format is given, the string is returned in the form 08/30/03 05:00 PM. Use q, qqq, or qqqq for short, medium or long versions of quarter notation. For example, qqq-yyyy will result in a string of the form Qtr 1-2005. This function returns a text string.

Return Type

Text

Arguments

Date (type = Text (Java standard Date/Time argument in milliseconds))

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Date Format

Returns a formatted string representing the specified Date. The Date must be a Java standard date/time argument in milliseconds from Jan 1, 1970. The Date Format specified is the same as the Java SimpleDateFormat class.   

For example, the format MMMM dd, yyyy hh:mm:ss a would result in the form August 30, 2003 05:32:12 PM. If no Date Format is given, the string is returned in the form 08/30/03 05:32 PM. This function returns a text string.

Return Type

Text

Arguments

Date (type = Text (Java standard Date/Time argument in milliseconds))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Date Now

Returns a string representing the current date and time. The Date Format specified is the same as the Java SimpleDateFormat class. For example, the format MMMM dd, yyyy hh:mm:ss a would result in the form August 30, 2003 05:32:12 PM. If no Date Format is given, the string is returned in the form 08/30/03 05:32 PM. This function returns a text string.

Return Type

Text

Arguments

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Delta

Calculates the rate of change of the Value over the Time Interval specified in seconds. If no Time Interval is given, the absolute delta is returned.

Return Type

Numeric

Arguments

Value (type = Numeric)

Interval (type = Numeric)

Divide

Divides the first argument by the second.

Return Type

Numeric

Arguments

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Duration

Takes a Duration argument in milliseconds and returns a text string representing that Duration. If no Duration Format is specified, the string is returned in the form "15:32" (hours:minutes). The Duration Format may contain any of the characters d, s, or . indicating that days, seconds, or milliseconds are to be included in addition to hours and minutes in the returned string.

Return Type

Text

Arguments

Duration (type = Text)

Duration Format (type = Text (e.g., ds))

Evaluate Expression As Double

Evaluates the given expression and returns the result as a double. NOTE: Boolean true or false values will be returned as 1 and 0 respectively.

Expression - Write an expression using variables including standard arithmetic and logical operators as well as a variety of mathematical and string functions. Variables specified in the expression must include a % prefix and cannot begin with a number (e.g. %var1 + %var2). String constants must be enclosed in double quotations (e.g. "%var1 + %var2").

When an Expression is specified and the field activated (by pressing Enter or navigating to another field) the dialog will update with a text field for each variable that requires a value. Values whose form is numeric are substituted into the expression as numbers, otherwise they are substituted into the expression as strings.

If a value whose column is numeric needs to be treated as a string, perhaps to serve as an argument to a string function, enclose the variable in the expression in double quotations (e.g. "length("%var1") + %var2".)

Return Type

Numeric

Arguments

Expression (type = Expression)

See “Expression Syntax Definition” for more information.

Evaluate Expression As String

Evaluates the given expression and returns the result as a text string.

Expression - Write an expression using variables including standard arithmetic and logical operators as well as a variety of mathematical and string functions. Variables specified in the expression must include a % prefix and cannot begin with a number (e.g. %var1 + %var2). String constants must be enclosed in double quotations (e.g. "%var1 + %var2").

When an Expression is specified and the field activated (by pressing Enter or navigating to another field) the dialog will update with a text field for each variable that requires a value. Values whose form is numeric are substituted into the expression as numbers, otherwise they are substituted into the expression as strings.

If a value whose column is numeric needs to be treated as a string, perhaps to serve as an argument to a string function, enclose the variable in the expression in double quotations (e.g. "length("%var1") + %var2".)

Return Type

Text

Arguments

Expression (type = Expression)

See “Expression Syntax Definition” for more information.

Execute Java Method

Allows you to write code for a Java method that will be executed when the function is updated. When you select this option, the following string displays containing the eval method in the Code field:

public Object eval() {

return “”;

}

This method can take zero or more arguments of type String, Integer, Double, or GmsTabularData. The method’s return type must be declared as an Object, but can return a String, Integer, Double, or GmsTabularData object.

The Java code you define is saved with the display (.rtv) file that contains the function and, on the first update, the function compiles the given Java code. See “Execute Java Method Function Type Requirements and Examples” for more information.

Format Number

Applies the specified Format to the Number To Format and returns a formatted string. The Format can be specified as a Java format specification, or with the following shorthand: $ for US dollar money values, $$ for US dollar money values with additional formatting, or () for non-money values, formatted similar to money.  For example, if Number To Format is 50, and Format is $ this function would return $50.00. Both positive and negative formats can be supplied, for example: #,###;(#,###).

Return Type

Numeric

Arguments

Number to Format (type = Numeric)

Format (type = Text (e.g., #,###;(#,###)))

Get Substitution

Returns the current value of the given Substitution String.

Return Type

Text

Arguments

Substitution String (type = Text)

isWindowsOS

Returns a value of 1 if RTView is not running in an applet and the operating system it is running on is Windows, otherwise it returns 0.

Return Type

Numeric

Arguments

Not applicable

Max

Returns larger of the two arguments.

Return Type

Numeric

Arguments

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Min

Returns smaller of the two arguments.

Return Type

Numeric

Arguments

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Modulo

Divides the Value by the Divisor and returns the remainder.

Return Type

Numeric

Arguments

Value (type = Numeric)

Divisor (type = Numeric)

Multiply

Multiplies the two arguments.

Return Type

Numeric

Arguments

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Percent

Computes the percentage of the Value, given the range defined by Min Value and Max Value. This function returns a number between 0 and 100.

Return Type

Numeric

Arguments

Value (type = Numeric)

Min Value (type = Numeric)

Max Value (type = Numeric)

Replace Value

Replaces the Value with associated text from Replacement Values. Replacement Values should contain pairs of values and replacement values separated by a :. If the names of values or replacement values listed in Replacement Values contain a space or a colon, they must be enclosed in single quotes.

For example, if the Value is Windows NT and pairs listed in Replacement Values are 'Windows NT':winnt Windows2000:win2k, the text string returned will be winnt.

If Return Value if No Match is set to 1, then the returned text will be the Value if no match. If Return Value if No Match is set to 0, then an empty text string will be returned if no match.

If there is no match found in the Replacement Values, the Default Value will be returned. Unless Return Value If No Match is set to 1, then the returned text will be the Value.

Return Type

Text

Arguments

Value (type = Text)

Replacement Values (type = Text (e.g., WindowsNT:winnt))

Return Value if No Match (type = Numeric)

Default Value (type = Text)

Set Substitution

Sets the Substitution String to the given Value. This function returns the value that has been set.

Return Type

Text

Arguments

Substitution String (type = Text)

Value (type = Numeric or Text)

Set Substitutions By Lookup

Sets multiple substitutions based on the values in the Lookup Table. The Key is compared against the values in the first column of the Lookup Table to determine which row to use to set substitution values. For each additional column in the Lookup Table where the column name starts with $, a substitution will be set on the display, where the substitution name is the name of the column and the substitution value is the value from that column in the row where the first column matched the Key.

 Add Dollar To Column Names - If Add Dollar To Column Names is set to 1, each column after the Key column is used to set a substitution regardless of whether or not it starts with $. For columns that do not start with $, a $ is added to the beginning of the column name when it is used as a substitution name. If Add Dollar To Column Names is set to 0, only columns starting with $ are used as described above.

Return Type

Text

Arguments

Key (type = Numeric or Text)

Lookup Table (type = Table)

Add Dollar To Column Names (type = Numeric)

Subtract

Subtracts the second argument from the first.

Return Type

Numeric

Arguments

Argument1 (type = Numeric)

Argument2 (type = Numeric)

Validate Substitution

Validates a substitution against a table of valid values.  

The Substitution String is compared to values found in the first column of the Valid Value Table. If the substitution value is not found, the Substitution String will be reset to the first value found in the table.

If Clear If Invalid is set to 1, the function will return an empty string if the substitution value is not found in the table.

To enter the Substitution String as a semicolon delimited list of values, set Allow Multiple Values to 1. Each value will be tested for validity and the final result will be assembled from all (if any) valid values found in the table.

Return Type

String

Arguments

Substitution String (type = String)

Valid Value Table (type = Table (Only the first column is used.))

Numeric (type = Clear If Invalid)

Numeric (type = Allow Multiple Values)

Expression Syntax Definition

The expression syntax for the functions Evaluate Expression As Double, Evaluate Expression As String, and Evaluate Expression By Row follows standard Java syntax and includes these operators and functions:

Operators

Precedence

unary

+   - !

multiplicative

*   /   %

additive

+   -

relational

<   >    <=   >=

equality

==   !=

logical

&&  ||

The following operators are not supported: 

§        bitwise NOT, AND, OR, XOR

§        arithmetic shift

All operators may be applied to double variables. In addition the relational and equality operators may be applied to string variables, and the addition operator may be used to concatenate strings.

The following arithmetic functions are supported:

§        abs

§        acos

§        asin

§        atan

§        atan2

§        ceil

§        cos

§        exp

§        floor

§        IEEEremainder

§        log

§        max

§        min

§        pow

§        random

§        rint

§        round

§        sin

§        sqrt

§        tan

§        toDegrees

§        toRadians

The following string functions are supported:

§        charAt

§        compareTo

§        compareToIgnoreCase

§        concat

§        condExpr

§        endsWith

§        equals

§        equalsIgnoreCase

§        indexOf

§        lastIndexOf

§        length

§        replace

§        startsWith

§        substring

§        toLowerCase

§        toUpperCase

§        trim

 

Definitions of Math Functions (per Java.Math)

Math Function

Definition

double abs(double a)

Returns the absolute value of a double value.

double acos(double a)

Returns the arc cosine of an angle, in the range of 0.0 through pi.

double asin(double a)

Returns the arc sine of an angle, in the range of -pi/2 through pi/2.

double atan(double a)

Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.

double atan2(double y, double x)

Converts rectangular coordinates (x, y) to polar (r, theta).

double ceil(double a)

Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer.

double cos(double a)

Returns the trigonometric cosine of an angle.

double exp(double a)

Returns Euler's number e raised to the power of a double value.

double floor(double a)

Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.

double IEEEremainder(double f1, double f2)

Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.

double log(double a)

Returns the natural logarithm (base e) of a double value.

double max(double a, double b)

Returns the greater of two double values.

double min(double a, double b)

Returns the smaller of two double values.

double pow(double a, double b)

Returns the value of the first argument raised to the power of the second argument.

double random()

Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.

double rint(double a)

Returns the double value that is closest in value to the argument and is equal to a mathematical integer.

long round(double a)

Returns the closest long to the argument.

double sin(double a)

Returns the trigonometric sine of an angle.

double sqrt(double a)

Returns the correctly rounded positive square root of a double value.

double tan(double a)

Returns the trigonometric tangent of an angle.

double toDegrees(double angrad)

Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

double toRadians(double angdeg)

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Definitions of String Functions (per Java.String)

String Function

Definition

char charAt(int index)

Returns the char value at the specified index.

int compareTo(String anotherString)

Compares two strings lexicographically.

int compareToIgnoreCase(String str)

Compares two strings lexicographically, ignoring case differences.

String condExpr(String expression, String value1, String value2)

Evaluated as true or false, returns value1 if true or value2 if false.

boolean endsWith(String suffix)

Tests if this string ends with the specified suffix.

boolean equals(Object anObject)

Compares this string to the specified object.

boolean equalsIgnoreCase(String anotherString)

Compares this String to another String, ignoring case considerations.

int indexOf(String str, int fromIndex)

Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.

int lastIndexOf(int ch, int fromIndex)

Returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.

int length()

Returns the length of this string.

String replace(char oldChar, char newChar)

Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.

boolean startsWith(String prefix, int toffset)

Tests if this string starts with the specified prefix beginning a specified index.

String substring(int beginIndex, int endIndex)

Returns a new string that is a substring of this string.

String toLowerCase()

Converts all of the characters in this String to lower case using the rules of the default locale.

String toUpperCase()

Converts all of the characters in this String to upper case using the rules of the default locale.

String trim()

Returns a copy of the string, with leading and trailing white.

Execute Java Method Function Type Requirements and Examples

The Execute Java Method function allows you to write code for a Java method that will be executed when the function is updated and is intended for implementing a 'one-of-a-kind' java method that is useful on a single RTView display. This section describes the basic requirements and provides some examples.

Requirements

§        The Java Development Kit (JDK) must be installed on systems that will be used to configure or run the Execute Java Method function. The Java Runtime Kit (JRE) is not sufficient since it does not include the Java compiler tools.

§        The person configuring the Execute Java Method function must be familiar with Java as well as with the com.sl.gmsjrt.GmsTabularData class if the function will deal with tabular data. See “Custom Functions” for more information.

§        The heap usage of the RTView application increases by about 6 to 10 MB to support the compiler.

§        The Execute Java Method function should only be used when appropriate to avoid maintenance and performance problems.

§        Since the Execute Java Method function is intended for a single RTView display then, if a method is needed on multiple RTView displays, it should be implemented in an RTView custom function handler class instead.

Code Argument

The function takes one predefined string argument named Code, plus any number of user-defined arguments as described later. The Code string must be a Java method named eval with this signature: public Object eval(args). For each new instance of the function, the Edit Function dialog will set the Code string to a "skeleton" implementation of the eval method as shown below:

public Object eval() {

 return "";

}

The eval method can take zero or more arguments of type String, Integer, Double, or GmsTabularData. The method's return type must be declared as Object, but it can return a String, Integer, Double, or GmsTabularData object.

The arguments declared for the eval() method become arguments to the rtview function instance, just like the %x, %y tokens in an Evaluate Expression function. For example, here is a simple eval method that concatenates two String args named s1 and s2:

public Object eval(String s1, String s2) {

   return s1 + ":" + s2;

}

In the Edit Function dialog, s1 and s2 will appear as argument fields so their values can be assigned to constants or attached to data:

concat2strings.gif

 

Here is a more complex example that takes a GmsTabularData argument. The input table is assumed to have an integer column named Value, and the function returns a copy of the input table with all rows removed where the Value column item is < 25 or > 75. The method makes use of utility methods named cloneInputTable and printErrorMessage, which are defined in the base class named com.sl.gmsjrtview.GmsJavaCodeExecutor:

DupNodeIDCol.gif

 

For documentation on the GmsTabularData and GmsJavaCodeExecutor classes, see “Customization” for more information.

Compilation 

The Java code entered as the value of the Code argument for a function named F101 is used to generate the source code for a subclass of com.sl.gmsjrtview.GmsJavaCodeExecutor, as follows:

package rtvfuncs;

import com.sl.gmsjrt.GmsTabularData;

import com.sl.gmsjrtview.*;

import java.util.*;

public class F101_Cnn extends com.sl.gmsjrtview.GmsJavaCodeExecutor {

// begin user-defined code

public Object eval() {

 return "";

}

// end user-defined code

}

The suffix _Cnn on the generated class name is not significant and will vary. The source code for the class will be generated and compiled the first time the function is updated after the .rtv file is loaded. In the Builder, source code for the class will also be generated and compiled each time the user changes the code for the eval method and clicks OK or Apply. The compiler will use the same classpath as the RTView application.

No external .java or .class files are produced for an Execute Java Method function. All source generation, compilation, and class loader operations are performed using memory buffers. The user-defined Java code for the eval method is saved with the function in the .rtv file.

As shown above, the generated source code imports com.sl.gmsjrtview.*, com.sl.gmsjrt.GmsTabularData, and java.util.*. If additional imports are needed they can be defined on lines above the eval() method in the Code argument, or globally with a property named sl.rtview.function.compiler_import. For example, these lines could be added to an rtview .properties file to import java.sql.* and java.math.* for all function instances:

sl.rtview.function.compiler_import=java.sql.*;

sl.rtview.function.compiler_import=java.math.*;

Compiler errors are logged to the console. The complete generated source code, as described above, is shown before the compiler error so that the user can make sense of the line numbers in the error message. For example, the eval() method shown below uses an undefined variable "s3", so the console shows the corresponding source code and the Java compiler error:

ExecuteJavaMethodTest1.gif

 

Examples

The following eval() implementation returns a table with 2 columns, "Name" and "Value", where the Name column contains "this is row N" and the Value column contains a random integer between 0 and 100. The number of rows in the table is determined by the numRows argument. The "trigger" argument could be attached to the result of a "Date Now" function to trigger the function periodically; otherwise, it will only update once.

public Object eval(int numRows, String trigger) {

 GmsTabularData t = new GmsTabularData();

 t.addColumn("Name", GmsTabularData.STRING);

 t.addColumn("Value", GmsTabularData.INTEGER);

 for (int row = 0; row < numRows; ++ row) {

 String name = "this is row " + row;

 int val = (int) (Math.random() * 100);

 t.addRow("");

 t.setCellValue(name, row, 0);

 t.setCellValue(val, row, 1);

 }

 return t;

}

This eval method takes a table as an argument. The input table is assumed to have an integer column named Value (for example, the table returned from the previous example), and the function returns a copy of the input table with all rows removed where the Value column item is < 25 or > 75:

public Object eval(GmsTabularData t) {

 if (t == null)

 return t;

 int valCol = t.getColumnIndex("Value");

 if (valCol < 0)

 return t;

ArrayList<Integer> rowsToRemove = new ArrayList<Integer>();

 for (int row = 0; row < t.getNumRows(); ++row) {

 int val = t.getIntCellValue(row, valCol);

 if (val < 25 || val > 75) {

 rowsToRemove.add(row);

 }

 }

 if (rowsToRemove.size() > 0) {

// don't modify input table, clone it

 t = cloneInputTable(t);

 t.removeRows(rowsToRemove);

 }

 return t;

}

This eval method implements a simple counter function. It declares an integer member variable named "count" and increments it on each update and returns the new count. The "trigger" argument could be attached to the result of a "Date Now" function, to trigger the function periodically. Otherwise, it will only update once.

private int count = 0;

public Object eval(String trigger) {

 return ++count;

}

This eval method implements a counter function, similar to the previous example, but it demonstrates the use of the skipUpdate() method to prevent updating the function result in certain cases:

private int count = 0;

public Object eval(String trigger) {

 ++count;

 if (count % 5 == 0) {

// don't update result for multiples of 5

 System.out.println("skip counter update: " + count);

 skipUpdate();

 }

 return count;

}

This eval method takes a table as an argument. The input table is assumed to have an string column named Status (for example, production_table in update.xml produced by the RTView XML data simulator). The function returns a copy of the input table with the string in the Status column truncated to the length specified by the second argument, numCharsForStatusCol:

public Object eval(GmsTabularData prodTable, int numCharsForStatusCol) {

 if (prodTable == null || prodTable.getNumRows() < 1)

 return prodTable;

 prodTable = cloneInputTable(prodTable);

 int statusCol = prodTable.getColumnIndex("Status");

 if (statusCol < 0) {

 printErrorMessage("no Status column");

 return prodTable;

 }

 for (int row = 0; row < prodTable.getNumRows(); ++row) {

 String sts = prodTable.getCellValue(row, statusCol);

 if (sts != null && sts.length() > numCharsForStatusCol) {

 sts = sts.substring(0, numCharsForStatusCol);

 prodTable.setCellValue(sts, row, statusCol);

 }

 }

 return prodTable;

}

Tabular Functions

Add All Rows or Columns

Calculates the sum within each row or column of the specified Table.  

All numerical columns will be included in the calculation.

Result Column - 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 - Used to specify a label for the result row or column. To have the Result Label placed in a particular column (when Return Column is 0), specify a column name in Result Label Column.

Return Type 

Table

Arguments 

Table (type = Table)

Return Column (type = Numeric)

Result Label (type = Text for Column or Row Label. Default label is Total)

Result Label Column (type = Name of Table Column)

Add Columns

Calculates the sum of the specified columns within the specified Table.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Average All Rows or Columns

Calculates the average within each row or column of the specified Table.

All numerical columns will be included in the calculation.

Result Column - 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 - Used to specify a label for the result row or column. To have the Result Label placed in a particular column (when Return Column is 0), specify a column name in Result Label Column.

Return Type 

Table

Arguments 

Table (type = Table)

Return Column (type = Numeric)

Result Label (type = Text for Column or Row Label. Default label is Average)

Result Label Column (type = Name of Table Column)

Average Columns

Calculates the average of the specified columns within the specified Table.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Baseline Over Time

Calculates a baseline average of the values in the specified Table over the number of Date Part Intervals and offsets the timestamp to a Reference Time.

The Table must contain a time column and a number column.

This function returns a table containing a baseline calculated for the Number of Intervals specified or for all of the data in the Table if the Number of Intervals is 0.

Date Part - 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 Date Part will default to seconds.

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.

Return Type 

Table

Arguments 

Table (type = Table)

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Parts per Interval (type = Numeric)

Number of Intervals (type = Numeric)

Reference Time (type = Text)

Buffer Table Rows

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

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

Note: If the result of this function is used as the input to another function, all rows will be removed from the buffer table after the other function is updated regardless of the Number of Rows specified.

Table - Name of input table.

Number Of Rows - Specify the number of rows in the returned buffer table. If necessary, older rows will be removed to maintain this value.

Return Type 

Table

Arguments 

Table (type = Table)

Number of Rows (type = Numeric)

Combine

Combines Table 1 and Table 2 into a single table. When Combine Rows is 0, the combined table will contain the columns from Table 1 followed by the columns from Table 2. When Combine Rows is 1, the combined table will contain the rows from Table 1 followed by the rows from Table 2. In addition, when Combine Rows is 1, set Ignore Column Names to 0 to reorder the columns of Table 2 so its column names match Table 1 before merging rows. Set Ignore Column Names to 1 to merge rows without trying to match columns by name.

Return Type 

Table

Arguments 

Table 1 (type = Table)

Table 2 (type = Table)

Combine Rows (type = Numeric)

Ignore Column Names (type = Numeric)

Combine Multi-Server Tables

Combine tables from a multi-server data attachment* into a single table, using the DataServerName column as the index column.

Table - A column named DataServerName will be added as the first column of the returned table and contain the name of each data server from which a table is received. The combined table is returned by the function and stored internally for use on the next update. For example, when a table is received from a data server named ds101 it is combined with the previous result table, replacing any existing rows from ds101.

Note: It is assumed that the value of this argument will be supplied by a multi-server data attachment. A multi-server data attachment is one in which a single data attachment is directed to multiple data servers. For details, refer the Attach to Data section for your data source(s).

Return Type 

Table

Arguments 

Table (type = Table)

Concatenate Columns

Creates a string concatenation of the values in the given table columns separated by the given Separator(s) and returns the results in a new table column.

Specify a semi-colon (;) delimited list of column names for Columns to Concatenate.

The Separator can be a single character such as period (.) or forward slash (/), but it can also be a string such as and.

Return Type 

Table

Arguments 

Table (type = Table)

Columns to Concatenate (type = Text)

Separator (type = Text)

Convert Columns

Converts the specified columns to the specified type and replaces the input columns with the results.

Specify a single column name or a semi-colon (;) delimited list of column names for Columns to Convert.

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

Note: Convert to Type options (Boolean, Integer, Long, Float, Double, String or Time) may be abbreviated to the first letter.

Return Type 

Table

Arguments 

Table (type = Table)

Columns to Convert (type = Text)

Convert to Type (type =Text (Boolean, Integer, Long, Float, Double, String, or Time.))

Copy

Copies the specified Table.

Return Type 

Table

Arguments 

Table (type = Table)

Count

Counts rows in the specified Table Column.

Return Type 

Numeric

Arguments 

Table Column (type = Table Column)

Count By Bands

Divides the range given by the Min Value and Max Value into bands and counts the number of rows in the Table argument that contain a value that lies within each band.

This function accepts as arguments a Min Value, Max Value and Number of Bands and returns a table containing one column that holds the midpoint values of each band (one row for each band), and N additional columns, one for each column that was contained in the specified Table. These columns contain the total counts of values that fall within the calculated bands. If the Return Cumulative Percents argument is set to true (1) then the returned columns will contain the cumulative percentage of the total count in each cell, rather than the individual counts.

Return Type 

Table

Arguments 

Table (type = Table)

Number of Bands (type = Numeric)

Include Min/Max (type = Numeric)

Min Value (type = Numeric)

Max Value (type = Numeric)

Return Cumulative Percent (type = Numeric)

Count Unique Values

Returns a table listing unique values and their counts from the specified Table Column.

To include rows in the returned table for values that are not always present in the Table Column, specify a table column in Value List that contains all possible values. If the Value List is not specified, all unique values from Table Column will be included in the returned table.

If Restrict to Value List is set to 0, all unique values from the Table Column will be 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 will be included.

Return Type 

Table

Arguments 

Table Column (type = Table Column)

Value List (type = Table Column)

Restrict to Value List (type = Numeric)

Count Unique Values By Time

Returns a table listing unique values and their counts from a specified Table, sorted by the number of Date Part Intervals. The Table must contain a time 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.

For Date Part, specify s, m, h, d, w, M, q or y for seconds, minutes, hours, days, weeks, months, quarters or years.

The optional Date Format argument controls the format in the returned table using the Java SimpleDateFormat class. Use q, qqq or qqqq for short, medium or long versions of quarter notation.

To include columns in the returned table for values not always present in the value column, specify a table column in the Value List argument containing all possible values.

If Restrict to Value List is 0, or if the Value List is not specified, all unique values from the value column are included in the returned table, otherwise only values from the Value List are included.

Return Type 

Table

Arguments 

Table (type = Table)

Date Parts Per Interval (type = Numeric)

Number Of Intervals (type = Numeric)

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Value List (type = Table Column)

Restrict to Value List (type = Numeric)

Create Selector List

Returns a two column table containing a list of values to be presented in a dropdown list.

If the Selector Table has two columns, selector names will be taken from the first column and their values from the second column. If the Selector Table has only one column, its contents will be used for both the names and values in the returned table.

If you enter an All Selector name, then the first row of the first column in the returned table will contain the specified All Selector name and the second column will contain a value of *.

If Sort Values is set to 1, your selector names column will be sorted alphabetically in the returned table; unless the text consists entirely of numbers in which case it will be sorted numerically.

To sort values in descending order set Sort Descending to 1, otherwise (if left blank or set to 0) values will be sorted in ascending order.

This function returns a table where the first column contains selector names and the second column contains their values.

Return Type 

Table

Arguments 

Selector Table (type = Table)

All Selector Name (type = Text)

Sort Values (type = Numeric)

Sort Descending (type = Numeric)

Delta Rows

Computes the delta between incoming rows of tabular data.

The Delta Rows function returns a table including, for the specified columns, new values for the difference between this update and the previous.

Delta Column Names - The name of one or more columns for which deltas will be calculated.

Note: This field cannot be left blank.

Index Column Names - The name 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.

Replace Data With Deltas - If set to 1, delta values will replace original values in the same column of the specified Table. If set to 0, new columns will be added. The new columns will use the delta columns names with Delta prefixed.

Display Negative Values - If set to 1, delta values less than zero will be displayed with a negative sign. If set to 0, they will be displayed as zero.

Return Type 

Table

Arguments 

Table (type = Table)

Delta Column Names (type = Name of Table Column)

Index Column Names (type = Name of Table Column)

Replace Data with Deltas (type = Numeric)

Display Negative Values (type = Numeric)

Delta And Rate Rows

The Delta And Rate Rows function returns a table for the specified columns, including: 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 named columns by prefixing Delta and Rate to the column name or they may replace the values in the input columns.

Table - The table of interest.

Delta Column Names - The names of one or more columns for which deltas will be calculated. At least one name must be given. The Time Column Name must be included after the other columns.

Index Column Names - The 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 - The name of a timestamp column that willbe used to calculate the rate of change. If left blank, the rate will not be computed and the Rate column will not be appended.

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.

Return Type 

Table

Arguments 

Table (type = Table)

Delta Column Names (type = Name of Table Column)

Index Column Names (type = Name of Table Column)

Replace Data with Deltas (type = Numeric)

Display Negative Values (type = Numeric)

Distinct Values

Returns a table that lists all unique values from the specified Column Name.

If Sort Values is set to 1, your selector names column will be sorted alphabetically in the returned table; unless the text consists entirely of numbers in which case it will be sorted numerically.

To sort values in descending order set Sort Descending to 1, otherwise (if left blank or set to 0) values will be sorted in ascending order.

If Use Column Names is set to 1, then the original column name will be used in the resulting table. If set to 0, the resulting column will be given the name Values.

Note: Generic column names like this are useful when the data attachment for the Table argument uses a substitution that will cause the column names to change when the substitution changes.

Return Type 

Table

Arguments 

Table (type = Table)

Column Name (type = Name of Table Column)

Sort Values (type = Numeric)

Sort Descending (type = Numeric)

Use Column Names (type = Numeric)

Divide Columns

Divides the value of each row in the second column into the corresponding rows in first column of the specified Table.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Ensure Columns

Returns a copy of the specified table with given column name(s) guaranteed to be of the given column type(s).

Table - The table of interest.

Column Name(s) - A single column name or a semi-colon (;) delimited list of column names.

Column Type(s) - A single column type or a semi-colon (;) delimited list of column types.

Note: Column Type(s) (i.e. Boolean, Integer, Long, Float, Double, String or Time) may be abbreviated to the first letter.

Value(s) - A single value or a semi-colon (;) delimited list of values. Semi-colons are supported as literals in the Value(s) argument if:  

 there is only one value in the Column Name(s) argument, and

 the Value(s) argument is enclosed in single quotes.

If those conditions are not met, the semi-colon is assumed to be a delimiter for multiple values.

If the Table input parameter to this function does not have a column defined in the Column Name(s) parameter, it creates the column of type Column Type(s) with the designated initial Value(s). For columns of type String, Integer and Long, if either no value is provided, or it is not possible to convert the provided value to the column type, the default setting is placed in the column: blank for String and 0 for Integer and Long. For columns of type Double, if no value is provided the column displays 0. And if a value is provided that cannot be converted to Double, the column displays NaN.

The Value(s) parameter can be used to supply a list of values for initializing new columns added to the table (existing columns do not change). The values are applied to the new columns in the order they are created and converted to the corresponding column type if possible. Otherwise, the result is blank for string, 0 for integer/long, and NaN for double.

Return Type 

Table

Arguments 

Table (type = Table)

Column Name(s) (type = Name of Table Column(s))

Column Type(s) (type = Text (Boolean, Integer, Long, Float, Double, String or Time.))

Value(s) (type = Text or Numeric)

Evaluate Expression By Row

Evaluates the expression for all rows of the specified Table, using values from the columns specified, and returns the results in a new table column.

Expression - Write an expression using variables including standard arithmetic and logical operators as well as a variety of mathematical and string functions. Variables specified in the expression must include a % prefix and cannot begin with a number (e.g. %col1 + %col2). String constants must be enclosed in double quotations (e.g. "%col1 + %col2").

If a value whose column is numeric needs to be treated as a string, perhaps to serve as an argument to a string function, enclose the variable in the expression in double quotations (e.g. "length("%col1") + %col2".)

When an Expression is specified and the field activated (by pressing Enter or navigating to another field) the dialog will update with a text field for each variable. Enter the names of columns in the specified Table from which values will be substituted for the corresponding variables in the expression. The types of the values are taken from the types of the columns.

Note: Numeric and Boolean values are converted to Double. Date columns are not supported.

Result Column Name - Specifies the name of the column that will be added to the table.

Result Column Type - Specifies the type of that column that will be added to the table: Double or String (may be abbreviated to the first letter).

Return Type 

Table

Arguments 

Table (type = Table)

Expression (type = Expression)

Result Column Name (type = Name of Table Column)

Result Column Type (type = Text (Double or String))

See “Expression Syntax Definition” for more information.

Filter And Extract Matches

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

Filter Column - Name specified the column to which the pattern is to be applied. If left blank, the pattern is applied to the row name.

If Pattern Is Regular Expression is set to 0 (the default), then Pattern should contain a string where * is a wildcard. Otherwise, Pattern should contain a regular expression as described at:

http://java.sun.com/j2se/1.5/docs/api/java/util/regex/Pattern.html

Number of New Columns specifies the number of new columns that should be added to the result table to contain the matching groups extracted from the filter column. New Column Names specifies the names for each of the new columns, separated by semicolon.

For example, if Number of New Columns is 2 and New Column Names is FirstName;LastName then the result table will contain 2 additional columns named FirstName and LastName, after all the columns from the input table. Furthermore, if Filter Column Name is CustomerName and Pattern is * * and PatternIsRegExpr is zero, then if a row in the input table contains Joe Smith in the CustomerName column, the corresponding row in the result table will contain Joe in the FirstName column and Smith in the LastName column.

Return Type 

Table

Arguments 

Table (type = Table)

Filter Column (type = Name of Table Column)

Pattern (type = Text)

Pattern is a Regular Expression (type = Numeric)

Number of New Columns (type = Numeric)

New Column Names (type = Text)

Filter By Pattern

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

Filter Column Name - A string that specifies the name of the column in the input table to which the pattern is applied. If this argument is blank, then the pattern is applied to the row name.

Pattern - A string that specifies a pattern. For each row in the Table, if the value in the specified column matches the pattern then the row is included in the result table.

Pattern Is Regular Expression - If 0 (the default), then Pattern should contain a string where * is a wildcard that represents any character, including none. If nonzero then Pattern must contain a regular expression as described at: http://java.sun.com/j2se/1.5/docs/api/java/util/regex/Pattern.html

Return Type 

Table

Arguments 

Table (type = Table)

Filter Column (type = Name of Table Column)

Pattern (type = Text)

Pattern is a Regular Expression (type = Numeric)

Filter By Row

Returns a copy of the specified Table containing only those rows in which the value of the Filter Column exactly matches the Filter Value.

It is possible to indicate multiple columns for the filter and multiple values to compare against for each column.

Note: If the number of specified column names does not correspond to the number of values listed, then extra names and/or values are ignored.

Multiple Filter Column Names should be entered as a semicolon (;) delimited list (i.e. col1;col2;col 3). If your column name contains a space or a semicolon, then the entire name must be enclosed in single quotes.

Enter * for Filter Value to display all rows in the table. To use * as a literal comparative value, it must be enclosed in single quotes. Multiple Filter Values should be entered as a nested list, where values for a given column are separated by commas within a semicolon (;) delimited list (i.e. val1,val2;val3,val4;val5,val6). If your filter value contains a space or a semicolon, then the entire value must be enclosed in single quotes.

Note: Spaces around separators are not allowed.

Return Type 

Table

Arguments 

Table (type = Table)

Filter Column Name (type = Name of Table Column)

Filter Value (type = Text or Numeric)

Filter By Time Range

Returns a copy of the specified Table, containing only those rows in which the value in the Date/Time Column falls within the given Time Range.

Date/Time Column Name - Name of a column containing a timestamp. If left blank, the first column is assumed to contain a timestamp.

Time Range Start - (Optional) A date/time included in the range.

Time Range End - (Optional) A date/time included in the range. Note: the actual end time used is one second less than this value, so it is non-inclusive.

Return Type 

Table

Arguments 

Table (type = Table)

Date/Time Column Name (type = Name of Table Column)

Time Range Start (type = Text)

Time Range End (type = Text)

First Table Rows

Returns the first N rows of the given Table or the first N rows for each unique combination of values in the given Index Column(s), where N is the specified Number of Rows to return. If you choose to specify one or more Index Column Names, the values contained in each index column are concatenated to form a unique index and N rows are returned for each index.

Return Type 

Table

Arguments 

Table (type = Table)

Index Column Names (type = Name of Table Column(s))

Number of Rows (type = Numeric)

Format Table Columns

Applies the specified Column Format(s) to the Table To Format and returns a formatted table. Only the columns included in Column Format(s) will be formatted. The Column Format must include column name(s) and the column format(s) separated by :'s. The column name must be enclosed in single quotes if it contains a space. The column format can be specified as a 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 'Units Completed':$, the Units Completed column in the returned table would be formatted for money. Both positive and negative formats can be supplied, for example: #,###;(#,###).

Return Type 

Table

Arguments 

Table to Format (type = Table)

Column Format(s) (type = Text ('Units Completed':$))

Get Data Server Connection Status

Returns a table with status information about connections from the Display Builder and Display Viewer Application to the default Data Server and any Named Data Servers.

The returned table contains one row for each connection, with 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, otherwise False.

Status 

OK -- Connection is operational.

no connection -- No connection to the Data Server.

no service -- Valid http connection to the rtvdata servlet, but the servlet has no connection to its Data Server.

inactive --A Data Server connection designated to activate As Needed is inactive because it is not needed.

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 -- Configuration string that identifies the RTView version of the Data Server.

Return Type 

Table

Arguments 

Not applicable

Group By Time

Returns a table containing a summary of all the data in the given Table, subtotaled or aggregated over time as indicated by the Group Type. The summary data in the returned table are grouped into time intervals specified as a number of Date Parts over a Time Range.

Group Type -

The type of aggregation to perform. If left blank the default is sum. Permitted values are sum, avg, min, and max. When only one value is entered, that value will be applied to all columns in the given Table.

To specify multiple values, enter a semi-colon (;) delimited list. For example: avg;sum;avg. Note: The order of multiple values should correspond the order of columns in the given Table.

To specify column name(s) in the returned Table, add the suffix :ColumnName. For example: avg:Memory;sum:Threads.

Date/Time Column Name - Name of a column containing a timestamp. If left blank, the first column is assumed to contain a timestamp.

Date Part - 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 Date Part will default to seconds.

Date Parts Per Interval - The size of each interval in Date Parts.

Number Of Intervals - The number of intervals to return in the summary table, one row for each interval. If set to 0, the number of intervals is determined from the range of data in the Table, or the given Time Range.

Time Range Start - (Optional) A date/time included in the range.

Time Range End - (Optional) A date/time included in the range. Note: the actual end time used is one second less than this value, so it is non-inclusive.

Restrict To Time Range - If set to 1, the resulting summary table includes only those time intervals within the specified Range.

Use Column Names - Permits the retention of the original column names. When Use Column Names is set to 1 the original column names are retained. If Use Column Names is set to 0, generic column names will be used. The first column will be named Value and the second and subsequent columns will be named Value1, Value2, etc. Generic column names are useful if the attached data uses a substitution that will cause the column names to change when the substitution changes.

Return Type 

Table

Arguments 

Table (type = Table)

Group Type (type = Text (e.g., sum, count, avg, min, max)

Date/Time Column Name (type = Table Column)

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Parts per Interval (type = Numeric)

Number of Intervals (type = Numeric)

Time Range Start (type = Text)

Time Range End (type = Text)

Restrict to Time Range (type = Numeric)

Use Column Names (type = Numeric)

Group By Time and Unique Values

Returns a table containing a summary of all the data in the given Table, subtotaled or aggregated over time and index columns as indicated by the Group Type. The summary data in the returned table are grouped into time intervals specified as a number of Date Parts over a Time Range, with a further breakdown by Unique Values in the Index Columns.

Group Type -

The type of aggregation to perform. If left blank the default is sum. Permitted values are sum, avg, min and max, and count. When only one value is entered, that value will be applied to all columns in the given Table.

When the Group Type count is specified, a column named Count (that displays the number of rows from the input table that were grouped) will automatically be added as the last column in the returned Table.

Note: When multiple Group Type values are specified, count must be entered last (e.g. avg;sum;count).

To specify multiple values, enter a semi-colon (;) delimited list. For example: avg;sum;avg. Note: The order of multiple values should correspond the order of columns in the given Table.

To specify column name(s) in the returned Table, add the suffix :ColumnName. For example: avg:Memory;sum:Threads.

Date/Time Column Name - Name of a column containing a timestamp. If left blank, the first column is assumed to contain a timestamp.

Date Part - 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 Date Part will default to seconds.

Date Parts Per Interval - The size of each interval in Date Parts.

Number Of Intervals - The number of intervals to return in the summary table, one row for each interval. If set to 0, the number of intervals is determined from the range of data in the Table, or the given Time Range.

Time Range Start - (Optional) A date/time included in the range.

Time Range End - (Optional) A date/time included in the range. Note: the actual end time used is one second less than this value, so it is non-inclusive.

Restrict To Time Range - If set to 1, the resulting summary table includes only those time intervals within the specified Range.

Index Column Names - The names of one or more columns that uniquely identify a row in the table. If left blank, the default is to aggregate only by time interval. The values contained in each index column are concatenated to form a unique index used to organize the resulting summary data.

Value List - A table column containing a set of values which will 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 - If set to 1, the returned table contains only rows that include the values of the specified Value List.

 

Return Type 

Table

Arguments 

Table (type = Table)

Group Type (type =Text (e.g., sum, count, avg, min, max))

Date/Time Column Name (type =Table Column)

Date Part (type =Text (e.g., s, m, h, d, w, M, q, y))

Date Parts per Interval (type =Numeric)

Number of Intervals (type =Numeric)

Time Range Start (type =Text)

Time Range End (type =Text)

Restrict to Time Range (type =Numeric)

Index Column Names (type =Name of Table Column(s))

Value List (type =Name of Table Column)

Restrict to Value List (type =Numeric)

Group By Unique Values

Returns a table containing a summary of all the data in the given Table, subtotaled or aggregated as indicated by the Group Type. The summary data in the returned table are broken down by all combinations of unique values found in the specified Index Columns.

Group Type -

The type of aggregation to perform. If left blank the default is sum. Permitted values are sum, avg, min and max, and count. When only one value is entered, that value will be applied to all columns in the given Table.

When the Group Type count is specified, a column named Count  (that displays the number of rows from the input table that were grouped) will automatically be added as the last column in the returned Table. Note: When multiple Group Type values are specified, count must be entered last (e.g. avg;sum;count).

To specify multiple values, enter a semi-colon (;) delimited list. For example: avg;sum;avg. Note: The order of multiple values should correspond the order of columns in the given Table.

To specify column name(s) in the  returned Table, add the suffix :ColumnName. For example: avg:Memory;sum:Threads.

Index Column Names - The names of one or more columns that uniquely identify a row in the table. If left blank, the default is to use the first column in the Table as the index column. The values contained in each index column are concatenated to form a unique index used to organize the resulting summary data.

Value List - A table column containing a set of values which will 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 - If set to 1, the returned table contains only rows that include the values of the specified Value List.

Use Column Names - Permits the retention of the original column names. When Use Column Names is set to 1 the original column names are retained. If Use Column Names is set to 0, generic column names will be used. The first column will be named Value and the second and subsequent columns will be named Value1, Value2, etc. Generic column names are useful if the attached data uses a substitution that will cause the column names to change when the substitution changes.

Restrict To Data Combinations - If set to 1, 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.

Return Type 

Table

Arguments 

Table (type = Table)

Group Type (type = Text (e.g., sum, count, avg, min, max))

Index Column Names (type = Name of Table Column(s))

Value List (type = Name of Table Column)

Restrict to Value List (type = Numeric)

Use Column Names (type = Numeric)

Restrict To Data Combinations (type = Numeric)

Join

Join Performs an inner join of the Left Table and the Right Table on the columns specified in the Left Column Name and the Right Column Name fields.

Multiple column names should be entered as a semicolon (;) delimited list (i.e. col1;col2;col 3). The Left Column Name list must contain the same number of column names as the Right Column Name List and corresponding columns in each list must be of the same type.

If a Column Name field is left blank, the row name up to the first : (if the row name contains a :), will be used instead of a column value.

The joined table will contain all columns from the Left Table followed by all columns from the Right Table, and include all rows where the value in the Left Column exactly matches the value in the Right Column.

Enter a Column Include Mode to specify whether to include in the returned table the columns specified in the Left Column Name and Right Column Name fields. Available options (may be abbreviated to the first letter) are:

 None - Do not include columns specified in either Left Column Name or Right Column Name

 Left - Include only columns specified in Left Column Name

 Right - Include only columns specified in Right Column Name

 All - Include all columns specified in both Left Column Name and Right Column Name

If Column Include Mode is left blank, then all columns specified in Left Column Name and Right Column Name will be included.

Return Type 

Table

Arguments 

Left Table (type = Table)

Right Table (type = Table)

Left Column Name (type = Name(s) of Table Column, or leave blank to use row name))

Right Column Name (type = Name(s) of Table Column, or leave blank to use row name)

Column Include Mode (type = Text (None, Left, Right or All), or leave blank to include all)

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.

Multiple column names should be entered as a semicolon (;) delimited list (i.e. col1;col2;col 3). The Left Column Name list must contain the same number of column names as the Right Column Name List and corresponding columns in each list must be of the same type.

If a Column Name field is left blank, the row name up to the first : (if the row name contains a :), will be used instead of a column value.

The joined table will contain all columns from the Left Table followed by all columns from the Right Table, and include all rows where the value in the Left Column exactly matches the value in the Right Column.

Specify an Outer Join Type  (may be abbreviated to the first letter) to select additional rows to include in the joined table: Left (all rows from Left Table), Right (all rows from Right Table), or Full (all rows from both tables). If left blank, a Full outer join will be performed.

Note: If Full is selected, then the Column Include Mode>Merge option is recommended to ensure that the returned table contains only one set of the join columns and that all of those columns contain valid values for all rows in the result.

Enter a Column Include Mode to specify whether to include in the returned table the columns specified in the Left Column Name and Right Column Name fields. Available options (may be abbreviated to the first letter) are:

 None - Do not include columns specified in either Left Column Name or Right Column Name

 Left - Include only columns specified in Left Column Name

 Right - Include only columns specified in Right Column Name

 All - Include all columns specified in both Left Column Name and Right Column Name

 Merge - Include columns, names and values, specified in Left Column Name along with values from columns specified in Right Table Column Name. Note: To use the Merge option you should specify Outer Join Type>Full.

If Column Include Mode is left blank, then all columns specified in Left Column Name and Right Column Name will be included.

Note: In any row where there is no match for the joined column value, the cells from the other table will contain null values. Null values will be represented as follows: blank for strings, 0 for integers and longs, NaN for floats and doubles, and NULL_DATE for dates.

Return Type 

Table

Arguments 

Left Table (type = Table)

Right Table (type = Table)

Left Column Name (type = Name of Table Column, or leave blank to use row name)

Right Column Name (type = Name of Table Column, or leave blank to use row name

Outer Join Type (type = Text (Left, Right or Full))

Column Include Mode (type = Text (None, Left, Right, All or Merge), or leave blank to include all)

Last Table Rows

Last Table Rows Returns the last N rows of the given Table or the last N rows for each unique combination of values in the given Index Column(s), where N is the specified Number of Rows to return. If you choose to specify one or more Index Column Names, the values contained in each index column are concatenated to form a unique index and N rows are returned for each index.

Return Type 

Table

Arguments 

Table (type = Table)

Index Column Names (type = Name of Table Column(s))

Number of Rows (type = Numeric)

Mark Time Gaps

Examines a table of time-stamped data in which data is expected at regular intervals, and if any time gaps in the data are found, marks them by inserting rows containing NaNs into the returned table. The NaN values appear as breaks in a trace line if the data table is plotted on a trend graph.

If the time interval between any two rows in a table is greater than the expected interval, two new rows are inserted 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".) 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 time gap, 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 time gap.

Note: This feature assumes 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.

Table - The 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 timestamp column.

Expected Interval - 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.  Multiple column names should be entered as a semicolon (;) delimited list (i.e. col1;col2;col3). If no column names are specified, all columns with floating point values are marked.

Mark Columns With - Numerical value to be assigned when marking columns in the rows added to mark a gap. The default value is NaN.

Return Type 

Table

Arguments 

Table (type = Table)

Name of Timestamp Column (type = Text)

Expected Interval (type = Numeric, specify s, m, h or d)

Names of Columns to Mark (type = Text)

Mark Columns With (type = Numeric)

Max All Rows or Columns

Finds the maximum value within each column or row of the specified Table.

All numerical columns will be included in the calculation.

Result Column - 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 - Used to specify a label for the result row or column. To have the Result Label placed in a particular column (when Return Column is 0), specify a column name in Result Label Column.

Return Type 

Table

Arguments 

Table (type = Table)

Return Column (type = Numeric)

Result Label (type = Text for Column or Row Label. Default is Maximum.)

Result Label (type = Column Name of Table Column)

Max Columns

Finds the maximum value of specific columns within the specified Table. To use a column containing a date, both the First Column Name or Numeric Value and the Second Column Name or Numeric Value arguments must specify the name of a column of type date. This function does not support entering a date string for the argument.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Min All Rows or Columns

Finds the minimum value within each column or row of the specified Table.

All numerical columns will be included in the calculation.

Result Column - 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 - Used to specify a label for the result row or column. To have the Result Label placed in a particular column (when Return Column is 0), specify a column name in Result Label Column.

Return Type 

Table

Arguments 

Table (type = Table Column)

Return Column (type = Numeric)

Result Label (type = Text for Column or Row Label. Default is Minimum.)

Result Label Column (type = Name of Table Column)

Min Columns

Finds the minimum value of specific columns within the specified Table. To use a column containing a date, both the First Column Name or Numeric Value and the Second Column Name or Numeric Value arguments must specify the name of a column of type date. This function does not support entering a date string for the argument.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Modulo Columns

Divides the specified columns and returns the remainder in a new table column.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

Multiply Columns

Multiplies the specified columns.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type =Text or Numeric)

Second Column Name or Numeric Value (type =Text or Numeric)

Result Column Name (type =Name of Table Column)

Percent Columns

Divides the value of each row in the second column into corresponding rows in the first column of the specified Table and converts to a percentage.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type =Name of Table Column)

Pivot On Unique Values

Returns a table in which row data from the given Table has been rotated into columns.

The Pivot Name Column contains values that become new column names in the returned table.

The Key Column is used to group rows containing unique names in the Pivot Name Column into a single row. Enter a single column name or a semi-colon (;) delimited list of column names. When multiple column names are specified, results are grouped by unique occurrences of the combined values of all columns.

The Pivot Value Column contains the data of interest. All consecutive rows that contain the same value in the Key Column will have the data in the Pivot Value Column subtotaled into the same row of the resulting table, in the appropriate column.

To include columns in the returned table for names that are not present in the Pivot Name Column, specify a table column in the Name List argument which contains all possible names.

If Restrict to Name List is set to 0 or if the Name List is not specified, all unique values from the Pivot Name Column are included in the returned table, otherwise only values from the Name List will be included.

Return Type 

Table

Arguments 

Table (type = Table)

Key Column (type = Name(s) of Table Column)

Pivot Name Column (type = Name of Table Column)

Pivot Value Column (type = Name of Table Column)

Name List (type = Text)

Restrict To Name List (type = Numeric)

Reference

Makes a reference to the specified Table without copying the contents. This function returns a table.

Return Type 

Table

Arguments 

Table (type = Table)

Rename Columns

Returns a copy of the specified table with Column Name(s) replaced by the specified New Name(s).

Column Name(s) - Enter a single column name or a semi-colon (;) delimited list of column names.

New Name(s) - Enter a single column name or or a semi-colon (;) delimited list of column names to replace the specified Column Name(s).

Note: The number of Columns Name(s) entered cannot exceed the number of New Name(s) entered.

Return Type 

Table

Arguments 

Table (type = Table)

Column Name(s) (type = Name of Table Column(s))

New Name(s) (type = Renamed Table Column(s))

Replace Value in Rows

Replaces text in the specified Column Name with text from Replacement Values.

Column Name - Input column containing value to be replaced with associated text from specified Replacement Values.

Result Column Name - Name of column to be created.

Replacement Values - String that contains pairs of values and replacement values separated by (:) colons. NOTE: Any values or replacement values that contain a space or a colon must be enclosed in single quotes.

Return Value If No Match - Determines what value is stored in the Result Column for a row with no match. If greater than 0, then the original value from the input column will be used, otherwise the Default Value is used.

Default Value - String that is stored in the result column if there is no match and Return Value If Not Match is less than or equal to 0.

Return Type 

Table

Arguments 

Table (type = Table)

Column Name (type = Name of Table Column)

Result Column Name (type = Name of Result Column)

Replacement Values (type = String)

Return Value If No Match (type = Numeric)

Default Value (type = String)

RTView Info

Returns a table containing information about the selected RTView Item. Select from the following options:

 RTView Version Info

 Product Version Info

 Data Sources

Return Type 

Table

Arguments 

Item (type = Not Applicable)

Select Column

Returns a table containing only the column specified in Select Column Name from the given Table. This function returns table that contains all rows from the original table.

Return Type 

Table

Arguments 

Table (type = Table)

Select Column Name (type = Name of Table Column)

Send Table

This function can be used to send a table to a remote instance of the Data Server via socket or http. The RTVAgent data adapter is used to receive the table in the Data Server.

Connection - Connection for the remote RTVAgent. This should either be hostname:port (e.g. localhost:5665) or a URL for the rtvagent servlet (e.g. http://SomeServer/rtvagent).

Agent Name - Name of agent (sender) to the RTVAgent. NOTE: This name should be unique among all agents in the same Agent Class (e.g. District 5 Agent).

Agent Class - Name that uniquely identifies the class (type) to which this agent belongs (e.g. MyCompany.DistrictAgent).

Table Name - Name that identifies the Table to Send when it is received by the RTVAgent (e.g. Sales Table).

Table to Send - Table to be sent to the remote RTVAgent. Note: This is the only argument that should change on each update.

Insert Column For Agent Name - If 1, then a column named AgentName, that will contain the value of the Agent Name argument, is inserted into the specified Table to Send. This column is useful for identifying which rows were received from which agents, especially when multiple agents in the same class send tables with the same Table Name.

Insert Column For Agent Time - If 1, then a column named AgentTime (that contains the current time) is inserted into the specified Table to Send.

Return Type 

Table

Arguments 

Connection (type = String)

Agent Name (type = String)

Agent Class (type = String)

Table Name (type = String)

Table to Send (type = Table)

Insert Column For Agent Name (type = Numeric)

Insert Column For Agent Time (type = Numeric)

Sort Table

Returns a table sorted by the specified Sort Column Name. Specify a single column name or a semi-colon (;) delimited list of column names. If multiple column names are entered, the returned table will be sorted on the first column specified, then the second column, etc. If an invalid column name is entered the original table will be returned.

If Sort Descending is set to 0, the Table is sorted in descending order. If Sort Descending is set to 1, the Table is sorted in ascending order.

Note: If your column contains text it will be sorted alphabetically, unless the text consists entirely of numbers, in which case it will be sorted numerically.

If Use Fast String Compare is set to 1, the java.lang.String.compareTo method is used to compare strings, which is fast but non-localized. If set to 0, the java.text.Collator.compare method is used to provide a localized string sort, but the sort will be somewhat slower. Default is 0.

Note: Use Fast String Compare may produce different results than a standard sort, since the sort is based on the value of the Unicode characters set.

Return Type 

Table

Arguments 

Table (type = Table)

Sort Column Name (type = Name of Table Column)

Sort Descending (type = Numeric)

Use Fast String Compare (type = Numeric)

Split String

This function returns a table with the given String split using the regular expression in the specified Separator.

The Separator should contain a regular expression as described at:

http://java.sun.com/j2se/1.5/docs/api/java/util/regex/Pattern.html 

Use Results Column Name to specify the name of the column in the returned table that contains the split results, one per row.

Return Type 

Table

Arguments 

String (type = String)

Separator (type = Regular Expression)

Results Column Name (type = Name of Table Column)

Store Table in Cache

This function provides a useful way of adding data from multiple sources into a single cache. Multiple functions can be created with various sources of data that all supply data to a single cache.

A value of 0 is returned if the named cache is not defined, otherwise 1 is returned.

Table - Name of table to be stored in a cache.

Cache Name - Name of the cache in which the table should be stored.

Note: This cache must already be defined.

Return Type 

Numeric

Arguments 

Table (type = Table)

Cache Name (type = Name of Cache)

Subtotal By Time

Subtotals the values in the specified Table by the number of Date Part Intervals. The Table must contain a time column and a number column. This function returns a table containing subtotals for the Number of Intervals specified or subtotals for all of the data in the Table if the Number of Intervals is 0. For Date Part, specify s, m, h, d, w, M, q, or y for seconds, minutes, hours, days, weeks, months, quarters or years. If left blank, the Date Part will default to seconds. The optional Date Format argument controls the format of the time in the returned table, using the Java SimpleDateFormat class. For example, the format EEE, hh:mm a will result in a string of the form Wed, 05:32 PM. Use q, qqq, or qqqq for short, medium or long versions of quarter notation. For example, qqq-yyyy will result in a string of the form Qtr 1-2005.If Date Format is left blank the Return Type of the first column in the table will be Date, otherwise it will be String.

Use Column Names - Permits the retention of the original column names. When Use Column Names is set to 1 the original column names are retained. If Use Column Names is set to 0, generic column names will be used. The first column will be named Interval and the second and subsequent columns will be named Subtotal 1, Subtotal 2, etc. Generic column names are useful if the attached data uses a substitution that will cause the column names to change when the substitution changes.

Return Type 

Table

Arguments 

Table (type = Table (must contain time column and numeric column))

Interval (type = Numeric)

Number of Intervals (type = Numeric)

Date Part (type = Text (e.g., s, m, h, d, w, M, q, y))

Date Format (type = Text (e.g., MMMM dd, yyyy hh:mm:ss a))

Use Column Names (type = Numeric)

Subtotal By Unique Values

Returns a table listing all of the unique values found in the first column of the Table Columns argument, along with the sum of the values in the corresponding fields of the remaining Table Columns.

To include rows in the returned table for values that are not always present in the Table Columns, specify a table column in the Value List argument which contains all possible values. If Restrict to Value List is set to 0 or if the Value List is not specified, all unique values from the Table Columns will be included in the returned table. Otherwise, only values from the Value List will be included. This function returns a table.

Use Column Names - Permits the retention of the original column names. When Use Column Names is set to 1 the original column names are retained. If Use Column Names is set to 0, generic column names will be used. The first column will be named Value and the second and subsequent columns will be named Total 1, Total 2, etc. Generic column names are useful if the attached data uses a substitution that will cause the column names to change when the substitution changes.

Return Type 

Table

Arguments 

Table Columns (type = Table Columns (enter two table columns))

Value List (type = Table Column)

Restrict to Value List (type = Numeric)

Use Column Names (type = Numeric)

Subtract Columns

Subtracts the value of each row in the second column from the corresponding rows in the first column of the specified Table.

Note: If a specified column is not found, the function attempts to convert the string argument to a numeric value. If this succeeds, the value is used as a constant in each row-wise operation.

Return Type 

Table

Arguments 

Table (type = Table)

First Column Name or Numeric Value (type = Text or Numeric)

Second Column Name or Numeric Value (type = Text or Numeric)

Result Column Name (type = Name of Table Column)

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 in the Comparison Table.

Return Type 

Table

Arguments 

Table (type = Table containing column in which to search for values from the Comparison Table)

Comparison Column Name (type = Name of column in Table in which to search for the values in the Comparison Table.)

Result Column Name (type = Name of boolean result column to add to Table. If no name is specified, the column will be named Result.)

Comparison Table (type = One column table containing values to look for in the Comparison Column of the Table.)