Making expressions for ad hoc parameters
The value of an ad hoc parameter can be a single value or an expression. Expressions use special characters called operators to select a group or range of values. For example, a greater than sign (>) specifies matching a value that is greater than the value that follows the symbol, as in >10. In this example, the greater than sign is the operator and 10 is the value.
There are 2 types of ad hoc parameters available to Information Console users; Dynamic Filters and Query by Example (QBE). Dynamic Filters requests users to build expressions using a single operator. Query by Example (QBE) syntax requests users to select one or more operators to also build complex expressions.
Examples of using expressions in an ad hoc parameter:
n A list of values, expressions, or ranges, separated by pipe signs, such as
10|20–30|>50. Some locales also accept a comma as a list separator.
n A group of values, such as (abc|xyz), that a Boolean expression can combine, such as (abc|xyz)&bbb.Dynamic Filters are used in BIRT design and document files. QBE ad hoc parameters are used in BIRT Spreadsheet and e.Report files.
Using a dynamic filter operator
Dynamic filters appear in BIRT design and document files. When dynamic filters exist in an Actuate file, Information Console prompts the user to select from a list of operators and supply a value. The developer decides which operators are available in an Actuate file.
Dynamic filters support multiple values and complex string expressions, depending on the operator. Data matching this expression displays in the output document of the file job.
Figure 4-23 shows an example of using dynamic filter operators to make an ad hoc expression.
Figure 4-23 Using dynamic filtersTable 4-3 lists the operators that are available in Actuate files. Developers select which operators are available to users of the file.
Table 4-3 Dynamic filter operators Greater than or equal toThe Like operator supports the following special characters:
n % matches zero or more characters. For example, %ace% matches any value that contains the string ace, such as Ace Corporation, Facebook, Kennedy Space Center, and MySpace.
n _ matches exactly one character. For example, t_n matches tan, ten, tin, and ton. It does not match teen or tn.The Match operator is case sensitive and supports special metacharacters that combine to form text patterns called regular expressions. For example, using ^H.*(Gifts|Collectables)$ to search through a list of company names matches all companies whose name starts with the letter H, has one or more letters after H and includes the word Gifts or Collectables at the end of the name.
If you need to match on a metacharacter, a backslash (\) followed by the metacharacter causes the search to interpret the metacharacter as a normal character.
For example, if $ is part of the data to be found, it must be entered as \$ because $ is a metacharacter. Table 4-4 lists the metacharacters available to form regular expressions with the Match operator.
Matches the previous character zero or more times. For example po* matches Liverpool and Leipzig. Matches the previous character one or more times. For example, po+ matches Singapore and Liverpool but not Leipzig. Matches the previous character zero or one times. For example, po? matches Singapore and Leipzig. Matches the previous character exactly y times. For example, o{2} matches Liverpool but not Lyon. Matches the start of the string. For example ^A matches Australia but does not match Los Angeles. Used with a metacharacter to make it a literal character. For example, to search for a string containing a $ sign, use \$.Table 4-5 provides examples of dynamic filter expressions.
Using Query by Example operators
Users build a QBE expression by combining operators and values, for example >10 is a QBE expression defining a value greater than ten. QBE expressions are available with BIRT Spreadsheet and e.Report files. Table 4-6 lists the operators available to form ad hoc parameter expressions.
Table 4-6 QBE operators used in ad hoc parameters Matches everything not equal to the search expression Matches everything greater than the value that follows the operator Greater than or equal to Matches everything greater than the value that follows the operator Matches everything less than the value that follows the operator Less than or equal to Matches everything less than or equal to the value that follows the operator Matches all characters in the set between the parenthesis Matches any character, group of characters, or no character Single quotation mark Converts an operator character in a string into a literal character
(c) Copyright Actuate Corporation 2011 |
![]() |