An expression involves arithmetic operators +, -, *, / and % (for remainders). It can use literal numbers, node id's (surrounded by '?' symbols), session variables or UDM parameters. The expression uses both date manipulation mechanisms and list functions

The Steps to Retrieve Data using Expressions -

  • Create a UDM
  • Add a child to the node.
  • Select a specific dataport. Click on Next button.
  • Then select from the dropdown list a specific datatype for the new node being added. Click on Next button.
  • Input database parameters for retrieving the data. Click on Next button
  • Input additional database parameters, if any.
  • Add another child node to the newly created node, selecting expression as the dataport. Click on Next button.
  • You need to specify the new node's datatype. This can be of three forms

                      I.      Boolean (True or False)
                      II.     Date and Time
                      III.    Number
                      IV.     String

 

  • Select any one of these. Click on the link " what's this?". This will open up a help for expressions which lists the various expressions that can be selected.

Date Functions
This helps you retrieve specific date or time related to various data. The date manipulation available with expressions are described in the table below

date.startOfMonth (x)

Returns a Date object containing the Date for the start of the month of x. x must be a Date object.

date.timeNow ()

Returns the current time as a Date object.

date.addDays (x, y)

Returns a Date object with y days added to x. Here, x must be a Date and y must be an integer. y can be negative.

date.addMonths (x, y)

Returns a Date object with y months added to x. Here, x must be a Date and y must be an integer. y can be negative.


  List Functions
The list functions enable you to get summary information from columns in lists. You can build complicated reports with ease using the list functions. Following is a description of the various built-in functions
 

list. sum (x)

Returns the sum of all occurrences of the (integer) node x. This function can only be applied at a sibling of a vector node.

list.ave (x)

Returns the average of all occurrences of the (integer) node x. This function can only be applied at a sibling of a vector node

list.min (x)

Returns the smallest object among all occurrences of the node x, which can be an integer, a string or a date. This function can only be applied at a sibling of a vector node

list.max (x)

Returns the largest object among all occurrences of the node x, which can be an integer, a string or a date. This function can only be applied at a sibling of a vector node.

  The end use of expression becomes clearer with the following examples
 

15 * ?4?

computes fifteen times the value in the UDM node with id 4. The latter must be of type integer.

date.addMonths('15-Nov-1999', 3)

returns a Date corresponding to February 15th, 2000. Notice that a literal string is being used where a Date is expected. The expression attempts to convert a few standard string representations into dates: It recognizes the mm/dd/yyyy format and the dd-MMM-yyyy format.

date.addDays (date.previousSunday (?5?), 3)

adds three days to the Sunday prior to the Date contained in node id 5 (which must be of type Date) and returns the result.

  You can use these expressions to build true business logic without any programming.