Defining Selection Criteria

You define selection criteria to selectively retrieve the data that you want. Selection criteria refine your query by specifying conditions that the retrieved data must meet. For example, you can specify that the system retrieve only those phone numbers with a certain area code instead of all phone numbers.

This chapter discusses how to:

Click to jump to parent topicChoosing Selection Criteria

Because your PeopleSoft database stores data in tables, you can identify every individual piece of data by saying what column (field) and row (record) it is in. When you create a query, select the data that you want by specifying which columns and rows you want the system to retrieve.

If you run the query after selecting the fields, the system retrieves all the data in those columns; that is, it retrieves the data from every row in the table or tables. This might be much more data than you want or need. You select which rows of data you want by adding selection criteria to the query.

The selection criteria serves as a test that the system applies to each row of data in the tables that you are querying. If the row passes the test, the system retrieves it; if the row does not pass, the system does not retrieve it. For example, suppose that you needed the names of all PeopleStore customers who were not PeopleSoft employees. You would start by creating a query that retrieved the Name and Company fields from the Customer table. You could then add a selection criterion that enables PeopleSoft Query to scan for rows where the company name is not PeopleSoft.

In most cases, a selection criterion compares the value in one of a row’s fields to a reference value. In the preceding example, you would compare the value in the Company field to the constant value PeopleSoft. In other situations, you might compare the value to the value in another record field or to a value that the user enters when running the query.

Click to jump to parent topicDefining Criteria

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicPages Used to Define Criteria

Page Name

Definition Name

Navigation

Usage

Query

QRY_QUERY

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page.

Click the Search button.

Click the Add Record link to select a record for the query.

Select a record for the query criteria.

Fields

QRY_FIELDS

Reporting Tools, Query, Query Manager, Fields

Select each field that you want to use in the query, and then click the Add Criteria icon, or click the Check All button to select all the fields associated with the record as criteria.

Select the fields to be used as criteria for the query.

Criteria

QRY_CRITERIA

Reporting Tools, Query, Query Manager, Criteria

View and edit selection criteria for your query statement.

Edit Criteria Properties

QRY_CRITERIA_SEC

Reporting Tools, Query, Query Manager, Criteria

Click the Add Criteria button on the Criteria page or click the Use As Criteria link on the Fields page.

Edit selection criteria properties for your query statement.

Click to jump to top of pageClick to jump to parent topicViewing and Editing Selection Criteria

Access the Criteria page by selecting Reporting Tools, Query, Query Manager, Criteria.

This is an example of the Criteria page:

Any rows after the first row must include either an AND or OR logical value in the Logical column to specify whether you want the rows to meet this criterion in addition to other criteria that you have defined or as an alternative criterion. The first criterion that you define does not have a value in this column. The default for subsequent criteria is AND.

To reorder the criteria for your query, click the Reorder Criteria button, enter the new positions for the criteria on the Edit Criteria Ordering page, and click OK. You can also click the Add Criteria button from this Criteria page to add additional criteria, and you can click the Group Criteria button to group your criteria logically.

Click to jump to top of pageClick to jump to parent topicEditing Criteria Properties

Use these steps to access the Edit Criteria Properties page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Create a new query or search for an existing one.

  3. Access the Criteria page, and click the Add Criteria button.

    Alternatively, access the Fields page and click the Use As Criteria link.

This is an example of the Edit Criteria Properties page:

Field

Select this option if you want to base the selection criterion on another field’s value, usually a field in another record component. To compare the values from fields in two records, you must join the record components.

When you select this option, you must then select a condition type.

See Selecting Condition Types.

Select the appropriate comparison operator from the Condition Type drop-down list box.

Expression

Select this option if you want PeopleSoft Query to evaluate an expression that you enter before comparing the result to the value in the selected field.

When you select this option and click the New Expression link to create a new expression, you must then select an expression type. If you are entering an aggregate value, select the Aggregate Function check box. You can also enter parameters for length and decimal positions.

Also enter the expression in the text box. Query Manager inserts this expression into the SQL.

Creating Criteria Based on a Field

To create criteria based on a field:

  1. Select Reporting Tools, Query, Query Manager.

  2. Create a new query or search for an existing one.

  3. Access the Criteria page, and click the Add Criteria button.

    Alternatively, access the Fields page and click the Use As Criteria link.

    If you accessed the page by clicking the Use As Criteria link on the Fields page, Query Manager displays the Edit Criteria Properties page with the selected field populated in the Expression 1 field.

  4. In the Edit Criteria Properties page, specify the criteria for the field, and click the OK button to return to the Fields or Criteria page.

    You can also use a field from a record as criteria even if you have not chosen that field for query output.

Creating Criteria Not Based on a Field

To create criteria that is not based on a field:

  1. Access the Edit Criteria Properties page by clicking the Add Criteria button on the Criteria page.

    The Edit Criteria Properties page appears enabling you to edit Expression 1 and Expression 2 fields.

  2. In the Choose Expression 1 Type group box, select the Field or Expression option.

  3. Edit the second (right-hand) Expression column to enter comparison values.

  4. Save your query.

Click to jump to top of pageClick to jump to parent topicSelecting Condition Types

The condition type determines how Query Manager compares the values of the first (left-hand) expression to the second (right-hand) expression.

Query Manager also offers a not option that reverses the effect of each condition type. For example, not equal to returns all rows that equal to would not return.

Note. You should use the not version of an operator rather than the NOT operator on the entire criterion. When you use NOT, PeopleSoft Query cannot use SQL indexes to speed up the data search. When you use the not version of an operator, PeopleSoft Query can translate it into a SQL expression that enables it to use the indexes.

This table describes the available condition types:

Condition Types

Return Values

between

The value in the selected record field falls between two comparison values. The range is inclusive.

equal to

The value in the selected record field exactly matches the comparison value.

exists

This operator is different from the others, in that it does not compare a record field to the comparison value. The comparison value is a subquery. If the subquery returns any data, PeopleSoft Query returns the corresponding row.

greater than

The value in the record field is greater than the comparison value.

in list

The value in the selected record field matches one of the comparison values in a list.

in tree

The value in the selected record field appears as a node in a tree created with PeopleSoft Tree Manager. The comparison value for this operator is a tree or branch of a tree that you want PeopleSoft Query to search.

Note. PeopleSoft Query should not use trees that contain a combination of dynamic details and range details. The results returned from trees with this combination of details may be inaccurate.

See Using PeopleSoft Tree Manager.

is null

The selected record field does not have a value in it. You do not specify a comparison value for this operator.

Key fields, required fields, character fields, and numeric fields do not allow null values.

less than

The value in the record field is less than the comparison value.

like

The value in the selected field matches a specified string pattern. The comparison value may be a string that contains wildcard characters. The wildcard characters that PeopleSoft Query recognizes are % and _.

% matches any string of zero or more characters. For example, C% matches any string starting with C, including C alone.

_ matches any single character. For example, _ones matches any five-character string ending with ones, such as Jones or Cones.

PeopleSoft Query also recognizes any wild-card characters that your database software supports. See your the documentation for your database management system for details.

To use one of the wild-card characters as a literal character (for example, to include a % in your string), precede the character with a \ (for example, percent\%).

Note. If you have selected the EFFDT field on an effective-dated table, PeopleSoft Query also offers special effective date operators.

Click to jump to top of pageClick to jump to parent topicEntering Comparison Values

This section provides an overview of comparison values and discusses how to:

The procedure for entering comparison values differs depending on what kind of value you are entering. If you are comparing one field to another, select the second record field; if you are comparing the rows to a constant value, enter the constant.

The following table describes all the available value types, the pages that appear based on each comparison type, and the fields that you must complete in those pages.

Value Type

Action

Field

The value in the selected field is compared to the value in another field, usually a field in another record component.

When you select Field as the comparison value, the Choose Record and Field page appears. The Record Alias field lists all the records that are part of the current query. Select the record and the field. The selected field name appears in the second Expression column of that field’s row.

Expression

The value in the selected field is compared to an expression that you enter, which PeopleSoft Query evaluates once for each row before comparing the result to the value in the selected field.

When you select Expression as the comparison value, the Define Expression page appears. In the text box, enter a valid SQL expression.

To add a field or user prompt to the expression, click the Add Field or Add Prompt link, respectively. These links display the same pages that you see when adding a field or prompt as a comparison value: Add Prompt displays the Run-time Prompt page; Add Field displays the Select a Field page. The only difference is that PeopleSoft Query adds the field or prompt to your expression rather than using it directly as the comparison value.

Constant

The value in the selected field is compared to a single fixed value.

When you select Constant as the comparison value, the Define Constant page appears. In the text box, enter the value that you want to compare the first expression to. To add a value by selecting it from a list, click the Look Up button to display the Select a Constant page.

Note. A list of constants is available only for fields that have translate values or an assigned prompt table.

Prompt

The value in the selected field is compared to a value that you enter when running the query.

When you select Prompt as the comparison value, the Define Prompt page appears. Click the New Prompt link to move to the Edit Prompt Properties page. To modify an existing prompt, click the Edit Prompt link.

See Defining Prompts.

Subquery

The value in the selected field is compared to the data that is returned by a subquery.

When you select Subquery as the comparison value, the Define Subquery page appears. Click the Define/Edit Subquery link to move to the Records tab to start a new query.

See Working with Subqueries.

In List

The value in the selected field is compared to a list of values that you enter. This value type is available only when the selected operator is in list or not in list.

When you select in list as your comparison value, the Edit List page appears. Use the Look Up button to display the Edit List page and search for the desired values.

Note. Values will appear here only if you have entered them previously.

Current Date

The value in the selected field is compared to the current date on the database server.

Tree Option

The value in the selected field is compared to a selected set of tree nodes. This value type is available only when the selected operator is in tree or not in tree.

When you select Tree Option as the comparison value, the Select Tree Node List page appears. Use this page to create a list of values for PeopleSoft Query to compare to the value from the first expression.

Tree Prompt Option

The value in the selected field enables you to select a tree value as a tree prompt, when the query is run. This value type is available only when the selected operator is in tree or not in tree.

When you select the Tree Prompt Option as the comparison value, all options to select tree values at design time are not available. However, you are able to select tree values as tree prompts when you run the query.

Effective Seq (effective sequence)

Used on some effective-dated records, the effective sequence is a sequencing number that is provided to further refine the effective date.

Note. Not all value types are available for all operators. For example, when you select the exists operator, Subquery is the only available value type. After you select an operator, PeopleSoft Query displays only the value types that are available for that operator.

Selecting a Constant Value

When you select Constant as your comparison value, the Define Constant page appears. In the text box, enter the value to which you want to compare the first expression. To add a value by selecting it from a list, click the Look Up button to display the Select a Constant page.

Note. A list of constants is available only for fields that have translate values or an assigned prompt table.

This is an example of the Select A Constant page:

To select a constant:

  1. Click the Look Up button on the Select A Constant page.

  2. Select the value that you want from the result list by clicking its associated link.

    The Select A Constant page appears again with the selected value in the field. If you are working with a date field, you can select a date/constant from a calendar.

  3. If more than one field exists on the Select A Constant page, you must repeat steps 1 and 2 for each field to further narrow your search for the constant.

  4. Click the OK button.

    The Edit Criteria Properties page appears with the selected value in the Define Constant page.

Another example of the Select A Constant page:

If this example, to select a constant, click a Select Constant link and the Edit Criteria Properties page reappears with the selected value in the Define Constant section.

Building a List of Values

When you select In List as your comparison value, the Edit List page appears. Use the Edit List page to build a list of values for PeopleSoft Query to compare to the value from the first expression. (After you have created such a list, you can also use this page to select from the list.)

To add a comparison value to the list, click the Look Up button on the Edit List page.

This is an example of the Edit List page, which dynamically reflects which record is used:

List Members

Lists the values that have been selected using the Add Value button.

Note. The grid, containing the selected value, appears when a value is selected.

To delete a value, select the check box to the left of the appropriate List Members value, and click the Delete Checked Values button.

Value

To add a value, enter it into the Value text box and click the Add Value button. The value appears in the List Members grid.

To select from a list of values, click the Search button to display the Select a Constant page. Click the Look Up button to display the Look Up page. Enter part of a value in the text box. (The system automatically adds a wild card to the end of the entry, which enables you to do a partial search. For example, if you enter a value of 10, the system returns all values, (up to a total of 300), that begin with 10, such as 10, 100, and 10069.) Click the Look Up button to display the list of values that corresponds to the search criteria.

Select the desired value from the list by clicking its associated link. When the Select a Constant page appears again, click the OK button, and the selected value appears in the List Members grid.

Add Prompt

Click to add one or more prompts to the list so that users can enter the comparison values when they run the query.

Note. The prompts must be defined before you can select them. If no prompts have been defined, you will receive an error message.

OK

Click to accept the values that are listed in the List Members grid.

You will return to the Edit Criteria Properties page, where the selected values are displayed in the Edit List page.

Cancel

Click to return to the Edit Criteria Properties page without saving selections.

Adding Prompts to an Expression List

You can add one or more prompts to the expression list so that users can enter comparison values when they run a query.

Note. You must have defined the prompts before you can add them to your expression list.

To add prompts to an expression list:

  1. With the expression list open, click the Add Prompt link in the Edit List page to access the Select a Prompt page.

  2. Click the required prompt.

    The prompt appears on the Edit List page.

    If you selected the in list operator, you may want to add more than one prompt so that your users can enter more than one value to search for.

  3. To add another prompt, click the Add Prompt link again and select a different prompt.

    Because you already have a prompt in place, a different page appears showing the prompt that you have already added.

  4. To add the next prompt, click the New button and complete the Run-time Prompt page.

    The settings for this second prompt are the same as those that are used with the first prompt. If you want a different label for this prompt, enter that label in the Heading Text text box.

    When you click the OK button, the second prompt appears in the Available Prompts list.

  5. Highlight the second prompt, and click the Select button to add it to the list of comparison values.

    The prompt then appears in the Edit List page.

  6. Repeat this process for each prompt that you want to add.

    When you finish adding prompts, click the OK button to close the Edit List page.

Adding Comparison Values to an Expression List

When you select the Tree option as the comparison value (available if you select the in tree or not in tree condition type), the Select Tree Node List page appears. Use this page to create a list of values for PeopleSoft Query to compare to the value from the first expression. Click the New Node List link to display the Select Tree page.

If the Selected Nodes List has been previously populated, you can either:

Click the name of the tree that you want to display the Display and Select TreeNodes page, which you can use to select which element of the tree PeopleSoft Query will check. If no nodes have been previously selected, the Selected Nodes List grid is collapsed. If you do not know the name of the tree, you can perform a search for the tree.

This is an example of the Select a Tree page:

This example shows how to select tree nodes in the Display and Select TreeNodes page:

To select tree nodes:

  1. In the Display and Select TreeNodes page, highlight the desired tree node, and click the Add Node icon.

  2. If you know the name of the node that you want, enter the name of the node in the Manual Selection list box.

    Alternatively, click the Look Up button to select the desired node from a list of available nodes. When you find the node that you’re looking for, click the Add to List button to add it to the list. The nodes that you enter or select from the list appear in the Selected Nodes list box.

  3. Remove nodes from the list by clicking the Remove from List icon corresponding to the node to be deleted.

  4. Display the selected tree branch by clicking the corresponding icon.

  5. When you are done selecting nodes, click OK.

    The selected tree setID, tree name, effective date, and nodes appear in the Select Tree Node List page.

Defining a Criteria with Tree Prompt in PeopleSoft Query

In addition to the option of selecting the tree value at design time for a criteria, Tree Prompts option will allow the user an option to select the tree and node value at run time. This allows the user to reuse the same query to get various organizational reports.

Note. In both web-based Query Manager and Windows client [psqed.exe], while creating a query you have the option of selecting to enter the tree details either at the design time or at the runtime. There is a Tree Prompt Option (an expression type) and a Tree Option when you select the condition type as In Tree or Not In Tree. Based on your selection, the tree option is handled to execute the query accordingly in the specified modules.

When you select the Tree Prompt Option as the comparison value, all options to select tree values at design time are not available. However, you are able to select tree values as criteria prompts when you run query.

This is an example of the Edit Criteria Properties with the Tree Prompt Option is selected:

After the Tree Prompt Option is selected:

Note. Query that has a criteria with tree prompts cannot be run as part of any process, either via Process Scheduler or from command line. For example, a crystal process which might need a query that has tree prompt to be executed to fetch data is not allowed (either by scheduling a process in Process Scheduler or using psccrun.exe at the command line). Although, you can execute the query with tree prompts from schedule query.

Click to jump to top of pageClick to jump to parent topicSpecifying Effective Date Criteria

Effective-dated tables have record definitions that include the Effective Date (EFFDT) field. This field, used throughout the PeopleSoft applications, provides a historical perspective enabling you to see how the data has changed over time. Whenever users add a row of data to the table, they specify the date on which that data becomes effective; whenever users change a row of data, they specify a new effective date and the system retains the previous version of the row as history.

When you use a PeopleSoft application for day-to-day processing, you usually want the system to give you the currently effective rows of data—the rows where the effective date is less than or equal to today’s date. You do not want to see the history rows, which are no longer accurate, nor do you want to see future-dated rows, which are not yet in effect.

When you query an effective-dated table, however, you may want to see some rows that are not currently in effect. You might want to see all the rows, regardless of their effective dates. Or you might want to see the rows that were effective as of some date in the past.

To specify effective date criteria:

  1. When you choose the record that has EFFDT as a key field, Query Manager automatically creates default criteria and adds that criteria to the Criteria page.

    This criteria is used to specify which row of data PeopleSoft Query retrieves for each item in the table. The default is the currently effective row. Defaults are:

    Expression 1

    Record Alias.EFFDT

    Condition Type

    EffDt <=

    Expression 2

    Current Date

    Effective Sequence

    Last

  2. If you select one of the comparison options, choose to compare each row’s effective date against today’s date or a date other than today.

Note. All options (except No Effective Date) return a single row for each item on the table. If you want a subset of the rows (for example, all future-dated rows or all history rows), enter a selection criterion in the Effective Date field. Use the standard comparison operators rather than the Effective Date comparison operators.

Remember that the effective date operators work differently than the standard comparison operators: they always return a single effective-dated row. For example, Eff Date <= returns the one row for which the EFFDT value is most recent, whereas not greater than would return the currently active row and all history rows.

See Also

Using Effective Dates

Click to jump to top of pageClick to jump to parent topicRelating Multiple Criteria

Using PeopleSoft Query, you can relate multiple criteria in specific ways that you define using the AND, AND NOT, OR, and OR NOT operators. You can also group criteria using parentheses.

This section discusses how to:

Using AND and OR Logical Operators

When you specify two or more selection criteria for a query, you must tell PeopleSoft Query how to coordinate the different criteria. For example, suppose you are querying your list of customers and you have defined two criteria: one selects customers from the state of Washington and another selects customers who have purchased airplanes. You may want PeopleSoft Query to return only those rows that meet both conditions (customers in Washington who have purchased airplanes), or you may want the rows that meet either one of the conditions (all Washington customers plus all customers who have purchased airplanes).

This diagram illustrates the rows that are returned by AND and OR:

Rows returned by AND and OR

When your query includes multiple criteria, link them using either AND, AND NOT, OR, or OR NOT. When you link two criteria with AND, a row must meet the first and the second criterion for PeopleSoft Query to return it. When you link two criteria with OR, a row must meet the first or the second criterion, but not necessarily both.

By default, PeopleSoft Query assumes that you want rows that meet all of the criteria that you specify. When you add a new criterion, PeopleSoft Query displays AND in the Logical column on the Criteria tab. To link the criterion using one of the other options instead, select the required option from the drop-down list box.

Grouping Criteria with Parentheses

When your query includes multiple criteria, PeopleSoft Query checks the criteria according to the rules of logic: it evaluates criteria that are linked by ANDs before those that are linked by ORs. When all the criteria are linked by ANDs, this order always returns the correct results. When you include one or more ORs, however, this is not always what you want.

For example, suppose you want a list of customers who are not friends and reside in either California (CA) or Florida (FL), you would enter the following criteria:

The set of criteria that was entered in the previous sample page returns a list of customers in California (except for those who are friends) and all customers in Florida (including those who are friends). This list results because PeopleSoft Query evaluates criteria in the order of appearance. It looks for rows where the customer is not friend and where the state is California or rows where the state is Florida.

What you really want PeopleSoft Query to search for are rows where the state is California or Florida, and where the customer type is not friend. That is, you want PeopleSoft Query to evaluate the OR before the AND. To accomplish this task, add parentheses to the list of criteria. When a list of criteria includes parentheses, PeopleSoft Query evaluates the criteria inside the parentheses before the criteria outside the parentheses.

Using the Group Criteria button on the Criteria page to access the Edit Criteria Grouping page where you can insert the opening parenthesis just before the field name and the closing parenthesis just after the comparison value. For example, the following settings of criteria return the results that you want:

To group criteria:

  1. Click the Group Criteria button on the Criteria tab.

    The Edit Criteria Grouping page appears.

  2. Use the edit boxes to enter parentheses for the criteria as needed.

    A parenthesis appears at the beginning of the Expression1 column for the first row that you selected and at the end of the Expression2 column for the last row that you selected. In the previous example, notice that the AND operator precedes the parentheses, while the OR operator is located within the parentheses.

    You can add as many parentheses as needed.

Click to jump to parent topicDefining Prompts

This section provides an overview of prompts and discusses how to edit prompt properties.

Click to jump to top of pageClick to jump to parent topicUnderstanding Prompts

Adding a prompt lets you further refine a query when you run it. For example, suppose that you want to change a query so that you could prompt the user to enter a value for the duration of a vacation. Before you add the prompt, the query always retrieves rows for employees who had taken vacation based on a defined constant value on which to make a comparison. Adding a prompt to the query enables the user to enter any duration, and then the query can return employees based on the value provided when running the query.

When you run a query with a prompt, a prompt page requests the required value. All date, time, and datetime prompt fields are required fields when running Query. Enter the value into the field. The query uses the value that you enter as the comparison value for the criterion that included the prompt.

If the field for which you are prompting has an associated prompt table (even if it is the Translate table), the Edit Table drop-down list box shows its name.

Click to jump to top of pageClick to jump to parent topicPages Used to Define Prompts

Page Name

Definition Name

Navigation

Usage

Prompts

QRY_PROMPT

Reporting Tools, Query, Query Manager, Prompts

Add or edit a prompt.

Edit Prompt Properties

QRY_PROMPT_SEC

Reporting Tools, Query, Query Manager, Prompts

Click the Add Prompt button or the Edit button on the Prompts page.

Edit the prompt properties.

Click to jump to top of pageClick to jump to parent topicEditing Prompt Properties

Use these steps to access the Edit Prompt Properties page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Add a new query or search for an existing one.

  3. Access the Prompts page.

  4. Click the Add Prompt button or the Edit button on the Prompts page.

    The Edit Prompt Properties page appears.

This is an example of the Edit Prompt Properties page:

To define prompts:

  1. From the Prompts page, click the Add Prompt button to add a new prompt, or click the appropriate Edit button to edit an existing prompt.

    The Edit Prompt Properties page appears.

  2. Click the Look Up button next to the Field Name field to select a prompt field.

    After you select a prompt field, the name of the field appears. PeopleSoft Query looks to the record definition for information about this field and completes the rest of the page based on its properties.

Type

Indicates the type of the field.

Format

Specifies the field format. Over a dozen formats are available, including Name, Phone, Social Security Number, and Zip Code.

Length

Indicates the field length.

Decimals

Defines the number of decimals that are allowed.

Edit Type

Defines the type of field edit for the specified field. No Table Edit is the default value. In general, you should use the same edit type that is used in the field record definition so that this edit type is consistent throughout Enterprise PeopleTools.

Heading Type

Select a heading type for the prompt from the following values:

  • Text: The prompt heading is the free text that you have entered in the text box.

  • RFT Short: The prompt heading is the short name from the record definition.

  • RFT Long: The prompt heading is the long name from the record definition.

Heading Text

Displays the label for the text box where you enter the comparison value. To change the text, select Text from the Heading Type drop-down list box, and then enter the new label in the Heading Text text box.

Unique Prompt Name

A default value that Query Manager generates for globalization. Only base language users can set this value to uniquely identify a query prompt parameter.

Prompt Table

If the edit type is Prompt Table, you can select a prompt table to use. If the edit type is Translate Table, the value in the drop-down list box determines the values used. PeopleSoft Query assumes that the specified field has translate table values associated with it, and that the field is identified as a translate table field in its record definition.

See PeopleSoft Query Security.

Note. When using a prompt table on a field from a record definition with multiple keys, you must prompt for all higher-level keys before lower-level keys. PeopleSoft Query needs values for the higher-level keys to generate the correct prompt list. Because of this complication, you should not use multikey prompt tables.

See Also

Adding Fields to Query Content

Click to jump to parent topicDefining HAVING Criteria

SQL does not support the use of aggregate functions in WHERE clauses. Therefore, after you have applied an aggregate function to a field, you cannot use that field in your selection criteria, which corresponds to a SQL WHERE clause. When you want to select rows based on the results of an aggregate function, Query Manager enables you to create HAVING criteria. You might use such criteria, for example, when you want a list of the departments whose minimum salary is greater than 100,000.00 USD.

In SQL, a HAVING clause is similar to a WHERE clause for rows of data that have been aggregated into a single row of output. The system evaluates WHERE clauses by looking at the individual table rows before they are grouped by the aggregate function, and then it evaluates HAVING clauses after applying the function. So if you want to check the value that is returned by the function, you must define a HAVING criterion.

When you click the Add Criteria icon from the Fields or Query pages for an aggregate field, new criteria is added to the Having page instead of the Criteria page. Add selection criteria using the Having page in the same way that you add selection criteria using the Criteria page.

Keep in mind that PeopleSoft Query compares the result of applying the aggregate function to the comparison value.

Click to jump to parent topicDefining Expressions

This section provides an overview of expressions and discusses how edit expression properties.

Click to jump to top of pageClick to jump to parent topicUnderstanding Expressions

Expressions are calculations that PeopleSoft Query performs as part of a query. Use them when you must calculate a value that PeopleSoft Query does not provide by default—for example, to add the values from two fields together or to multiply a field value by a constant.

You can work with an expression as if it were a field in the query: select it for output, change its column heading, or choose it as an “order by” column.

In Query Manager, you can use expressions in two ways:

Click to jump to top of pageClick to jump to parent topicEditing Expression Properties

Use these steps to access the Edit Expression Properties page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Add a new query or search for an existing one.

  3. Access the Expressions page.

  4. Click the Add Expression button or the Edit button.

    The Edit Expression Properties page appears.

This is an example of the Edit Expression Properties page:

To add or edit expressions for queries:

  1. Select Reporting Tools, Query, Query Manager, then click the Create New Query link, and then select the Expressions tab to open the Expressions page.

  2. The query name appears in the Query Name field.

    The default for this field is New Unsaved Query until you change it on the Properties page.

  3. Click the Add Expression button to open the Edit Expression Properties page, where you can select expression types.

  4. Select an option from the Expression Type drop-down list box.

    If you select Character, enter the maximum length of the expression result in the Length field.

    If you select Number or Signed Number, enter the total number of digits in the Length field and the number of digits after the decimal point in the Decimal field.

    Note. For Number and Signed Number, expression types, the Length field defines the total length of the number (integer portion + decimals portion). For example, if Length = 10 and Decimals = 3, then this means that the integer portion = 7 (Length - Decimals = Integer).

  5. If you are entering an aggregate value, such as SUM, AVG, or COUNT, select the Aggregate Expression check box.

  6. In the Expression Text field, enter the expression (for example, A. Total * .1, where A represents the first record.)

    Query Manager inserts the expression into the SQL for you. You can include Oracle hints in PeopleSoft Query expressions as long as you adhere to the following rules:

  7. Click the Add Prompt button to add prompt properties for this expression; click the Add Field button to add another field to this expression.

    Note. You must define a prompt, as described in the next section, before you can add it to your expression.

Using MetaSQL in Expressions

MetaSQL enables you to enter an expression that can be used across any supported database. For example, to concatenate strings, use the MetaSQL %CONCAT, and Enterprise PeopleTools will convert it to the appropriate database string concatenation function. To create a substring, use %SUBSTRING.

Note. You need to make sure that the expression type and length are set correctly for the data that is going to be returned. Only the MetaSQL functions that are valid for dynamic views will work with PeopleSoft Query.

See Also

Understanding Meta-SQL

Click to jump to parent topicDrilling URL in Oracle PeopleSoft Query

This section provides an overview of drilling URL in Oracle PeopleSoft Query, lists common terminology used in this section, and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Drilling URLs

Drilling URLs are the URLs that you define by selecting the menu, component, page, portal object, or URL of choice.

When you build a query using Query Manager, you can define drilling URLs that are associated with this query. These settings are saved into the database, along with prompt, criteria, and so on, as part of the metadata for this query. When you execute this query through Query Manager or Query Viewer, the query results page shows results as links, which you can click to be redirected to a different page in a new browser. Depending on how drilling URLs are defined, the new browser is either a PeopleSoft Pure Internet Architecture page, another query result page, or an external page.

Click to jump to top of pageClick to jump to parent topicCommon Terminology Used in This Section

Source Query

A query that defines a Drilling URL.

Destination Query

A query that was defined as a Drilling URL.

Destination Component

A component that was defined as a Drilling URL.

Click to jump to top of pageClick to jump to parent topicPages Used to Define Drilling URLs

Page Name

Definition Name

Navigation

Usage

Edit Expression Properties

QRY_QRYURL_SELECT

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Edit expression properties for your query statement.

Select a Query

QRY_FIELDS

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the Query URL link.

Select a query to build drilling URLs in a query URL format.

Query Search Page

QUERY_URL_SRCH_SPG

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the Query URL link.

Click the Prompt Key button next to the Query Name field.

Searching for a prompt criteria of the query to build URLs.

Select a Component

QRY_COMPURL_SELECT

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the Component URL link.

Select a component to build drilling URLs in a component URL format.

Select a Content Reference or Content Reference Link

QRY_CREFURL_SELECT

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the Component URL link.

Select a content reference or content reference link.

Enter an External URL

QRY_URL_SELECT

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the External URL link.

Enter an external URL to build drilling URLs in external URL format.

Enter an Attachment URL

QRY_ATTURL_SELECT

Reporting Tools, Query, Query Manager

Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

If you create a new query, click the Search button and click the Add Record link to select a record for the query.

Select the Expressions tab, and click the Add Expression button.

Select the Drilling URL option from the Expression Type list, and click the Attachment URL link.

Enter an attachment URL to build drilling URLs in attachment URL format.

Click to jump to top of pageClick to jump to parent topicViewing and Editing Expression Properties

Drilling URLs are a special type of expression that you can define using the Edit Expression Properties page in Query Manager.

To access the Edit Expression Properties page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

  3. If you create a new query, click the Search button and click the Add Record link to select a record for the query.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

This is an example of the Edit Expression Properties page:

Expression type

To define drilling URLs, you must select the Drilling URL option from the Expression type list.

Expression text

Optionally, type the URL in the Expression text text box.

Note. You have two options: type the URL in this Expression Text box or click the Query URL, Component URL, or External URL links to allow the appropriate system building URLs. If you type the URL directly into the Expression text box, the system does not validate against a value for the correct format.

Query URL

Click to access the Query URL definition widget, where you can select a query to build URLs in a query URL format.

Component URL

Click to access the Component URL definition widget, where you can select a component to build URLs in a component URL format.

External URL

Click to access the External URL definition widget, where you can enter external URL to build URLs in an external URL format.

Attachment URL

Click to access the Attachment URL definition widget, where you can enter attachment URL to build URLs in an attachment URL format.

Note. Drilling URLs are saved into database as an expression, so you have the option of accessing the Expressions page and adding the defined drilling URLs as fields. However, since drilling URLs are a special type of expression, you cannot add it as a criterion. You can add drilling URLs as query fields just like regular expressions. On a query result page, values in that column will be expanded to a fully qualified URL, which you can click to either run a query, access a PeopleSoft Pure Internet Architecture page, or go to an external URL.

See Defining Expressions.

Click to jump to top of pageClick to jump to parent topicDefining Query URL Widgets

The Query URL widget enables you to use the Select a Query page to build drilling URLs in a query URL format. You can click the Query URL link in the Edit Expression Properties page to access the Select a Query page.

To access the Select a Query page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

  3. If you create a new query, click the Search button and click the Add Record link to select a record for the query.

  4. Select the Expressions tab and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list.

  6. Click the Query URL link.

    The Select a Query page appears.

This is an example of the Select a Query page:

Query Name

Type a query name in the text box or click the query lookup icon to search for an existing query.

Prompt Keys

Click to access the Query Search Page where you can search for the prompt criteria of the query that you entered in the Query Name field. If the entered query has prompt criteria, a list of those fields appears in the URL Keys section. If the entered query has no prompt criteria, a message appears saying “Query does not contain any prompt key(s)”.

Note. This step is optional. If you do not map any prompt keys to the source query column field, then when you click a drilling URL link in query result column page, you will be directed to the Prompt page, where you can enter prompt key values before retrieving query result.

Select Field

Click to access the Select Query Column section.

See Selecting Query Columns for Existing Drilling URLs.

Map Columns

Click to display the Map URL to Query Columns section.

Note. This step is required for the drilling URLs to be available in a query results page.

You can define multiple drilling URLs in a query, but each query result column can only bind with one URL. Therefore, when you click the Column Mapping button, only those fields that have no bond with any URL appear in the Map URL to Query Columns section. If all query columns have bonds with other tracking URLs, then a message appears saying “All columns have already been mapped to other drilling URLs.”

URL Keys

The URL Keys section is available only after you define the Query field and click the Prompt Keys button.

In this URL Keys section, you define value mapping between Drilling URL destination query prompt fields and Drilling URL source query result column fields.

To map these fields, select the key field by selecting the check box adjacent to a prompt key field, and then click the lookup icon to select the source query column field to map to it.

Note. This step is optional. If you do not map any prompt keys to a source query column field, then when you click a drilling URL link on the query result column page, you will be directed to the Prompt page, where you can enter prompt key values before you retrieve query results.

Select Query Column

Select query result columns to form field name and value pairs and to define the order of the appended value pair in the URL.

Note. The Select Query Column section is available after you click the Select Field button.

See Selecting Query Columns for Existing Drilling URLs.

Map URL to Query Columns

The Map URL to Query Columns section is available only after you define the component values and click the Map Columns button.

Note. This step is required for the drilling URLs to be available in the query results page.

Use the Map Columns button for binding source query result column fields with Drilling URL. You must map URL to query result columns in order for the drilling URLs to be available as links in column fields of the source query results. You can define column mapping by selecting the appropriate check box in the Map URL to Query Columns section.

OK

Click to finish defining the Query URL widget and return to the Edit Expression Properties page.

Searching for Query

Access the Query Search page (from the Select a Query page, click the Prompt Keys button).

Query Search page

Use this page to search for the prompt criteria of the query that you entered in the Query Name field of the Select a Query page. If the entered query has prompt criteria, a list of those fields appears in the URL Keys section. If the entered query has no prompt criteria, a message appears saying “Query does not contain any prompt key(s)”.

Selecting Query Columns for Existing Drilling URLs

Using the Select Query Column section, you can append field name and value pairs to the end of existing Drilling URL types. The format of the appended field name and value pair is &FIELDNAME=VALUE.

For example:

Note. You can modify existing drilling URLs either at design time or at runtime.

Modifying Existing Drilling URLs at Design Time

You can modify existing drilling URLs at design time by entering the static field name and static value directly into the Expression Text field on the Edit Expression Properties page, as shown in this example:

You should follow these rules when you enter values directly into the Expression Text field:

Note. If you want to form a fieldname and value pair by selecting from query result columns, click the Select Field button on the Select Query URL, Select Component URL, or Select External URL page.

Modify Existing Drilling URLs at Runtime

At runtime, the query drilling URL process is able to modify all drilling URLs that are created in PeopleTools releases 8.50 and 8.51. For example, when you define the same drilling URL:

Note. In PeopleTools 8.50, drilling URLs must be expanded correctly. When you modify a drilling URL that was created in PeopleTools 8.51 and save it in PeopleTools 8.50, the system uses new format and syntax to form the URL.

In PeopleTools 8.51, when you run a query with the drilling URLs that were directly upgraded from PeopleTools 8.50, the runtime converts the format differences between the two releases.

Steps Used to Select a Query to Build Drilling URLs

To select a query to build drilling URLs:

  1. Select Reporting Tools, Query, Query Manager.

    The Query Manager search page appears.

  2. Click the Create New Query link on the Query Manager search page to create a source query, or click the Search button and open an existing one.

  3. If you create a new source query, click the Search button and click the Add Record link to select a record for the query.

    The Fields page appears.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list.

  6. Click the Query URL link to define drilling URL for the source query that you just created.

    The Select a Query page appears.

  7. Type a query name in the Query Name text box, or click the lookup icon to search for one from existing queries.

  8. Optionally, define value mapping in the URL Keys section.

    1. Click the Prompt Keys button to bind the prompt keys of the destination query with the columns of the source query.

      Note. If the destination query has prompt criteria, the URL Keys section appears with a list of key fields.

    2. Define value mapping in the URL Keys section by selecting the check box adjacent to a prompt key field, and then clicking the lookup icon to select a source query column field to map to it.

  9. Optionally, define query result columns for existing drilling URLs:

    1. Click the Select Field button to display the Select Query Column section.

    2. Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

  10. Optionally, define the column mapping in the Map URL to Query Columns section:

    1. Click the Map Columns button to map the drilling URL to a source query selected column.

    2. Select appropriate values from the Map URL to Query Columns section.

  11. Click the OK button.

    The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.

    This is an example of a drilling URL:

    '/q/?ICAction=ICQryNameURL=PUBLIC.DESTINATION&BIND1=A.DEPTID:A.DEPTID'

    In this example, the standard query URL format is:

    /q/?ICAction=ICQryNameURL=PUBLIC.DESTINATION&BIND1=A.DEPTID

    and the binding column is A.DEPTID. Thus, this drilling URL is binding with column A.DEPTID.

    Note that, a query drilling URL:

  12. Save your query.

  13. Select Reporting Tools, Query, Query Manager.

    Alternatively, select Reporting Tools, Query, Query Viewer.

  14. Click the HTML link or the Download to Excel link.

    The query results page displays results as links. When you click these links, the destination query is run using prompt key values that are defined using the source query.

Click to jump to top of pageClick to jump to parent topicDefining Component URL Widgets

The Component URL widget enables you to use the Select a Component page to build drilling URLs in component URL format. When you click the Component URL link in the Edit Expression Properties page to access the Select a Component page, a PeopleSoft Pure Internet Architecture page is launched.

Note. The Component URL widget is only used for pages that have the Action value set to Update/Display.

To access the Select a Component page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

  3. If you create a new query, click the Search button and click the Add Record link to select a record for the query.

  4. Select the Expressions tab.

  5. Click the Add Expression button.

    The Edit Expression Properties page appears.

  6. Select the Drilling URL option from the Expression Type list.

  7. Click the Component URL link.

    The Select a Component page appears.

This is an example of the Select a Component page:

Content Reference

Enter the name of a content reference or use the Add Content Reference Link link to select a content reference from an existing list.

See Administering Content References.

Add Content Reference Link

Click to access the Select a Content Reference or Content Reference Link page, where you can select a content reference or content reference link.

Note. The values of the Menu Name, Market, and Component fields are populated if you select a content reference or content reference link using the Add Content Reference Link link.

Menu Name

Enter a menu name or click the lookup icon and select one menu name from an existing list. Otherwise, the menu name value is populated if you select a content reference or content reference link using the Add Content Reference Link link.

Market

Enter a market code or click the lookup icon and select one market code from an existing list. The market code is populated automatically if you select a content reference or content reference link using the Add Content Reference Link link.

Component

Enter a component name or click the lookup icon and select one component name from an existing list. Otherwise, the component name value is populated if you select a content reference or content reference link using the Add Content Reference Link link.

Search Keys

Click to select mapping between component search keys and source query result columns.

If the entered component has a search key, a list of those search keys appears in the URL Keys section. If the entered component has no search key, a message appears saying “Component does not contain any search keys”.

Note. This step is optional. If you do not map any search keys to the source component, then when you click a drilling URL link in the query result column page, you will be directed to a component search page, where you can select search key values.

Select Field

Click to display the Select Query Column section.

See Selecting Query Columns for Existing Drilling URLs.

Map Columns

Click to display the Map URL to Query Columns section.

Note. This step is required for the drilling URLs to be available in query results page.

You can define multiple drilling URLs in a query, but each query result column can only bind with one URL. When you click the Map Columns button, only those fields that have no bond with any URL appear in the Map URL to Query Columns section. If all query columns have bonds with other tracking URLs, then a message appears saying “All columns have already been mapped to other drilling URLs.”

URL Keys

The URL Keys section is available only after you define the component and click the Search Keys button.

In this URL Keys section, you define value mapping between Drilling URL destination component search keys and Drilling URL source query result column fields.

To map these fields, select the key field by selecting its check box and, then click the lookup icon to select source query column field to map to it.

Note. This step is optional. If you do not map any search keys to the source component, then when you click a drilling URL link in query result column page, you will be directed to a component search page, where you can enter search key values before you launch the component.

Select Query Column

Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

See Modify Existing Drilling URLs at Runtime.

Map URL to Query Columns

The Map URL to Query Columns section is available only after you define the component values and click the Map Columns button.

Note. This step is required for the drilling URLs to be available in the query results page.

Use the Map Columns button for binding source query result column fields with a Drilling URL. You must map URLs to query result columns in order for the drilling URLs to be available as links in column fields of the source query results. You can define column mapping by selecting the appropriate check box in this Map URL to Query Columns section.

OK

Click to finish defining a Component URL widget and return to the Edit Expression Properties page.

Selecting a Content Reference or Content Reference Link

Access the Select a Content Reference or Content Reference Link page (from the Select a Component page, click the Add Content Reference Link link).

Use this page to select a content reference or content reference link.

Steps Used to Select a Component to Build Drilling URLs

To select a component to build drilling URLs:

  1. Select Reporting Tools, Query, Query Manager.

    The Query Manager search page appears.

  2. Click the Create New Query link on the Query Manager search page to create a source query, or click the Search button and open an existing one.

  3. If you create a new source query, click the Search button and click the Add Record link to select a record for the query.

    The Fields page appears.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list.

  6. Click the Component URL link to define a drilling URL for the source query that you just created.

    The Select a Component page appears.

  7. Type a content reference in the text box or click the Add Content Reference Link link to select one from existing components.

  8. If needed, define the values for the Menu Name, Market, and Component fields.

  9. Optionally, define value mapping in the URL Keys section.

    1. Click the Search Keys button.

      Note. If the selected component has a search key, the URL Keys section appears with a list of search key fields.

    2. Define value mapping in the URL Keys section by selecting an appropriate search field and selecting a source query results column.

  10. Optionally, define query result columns for existing drilling URLs:

    1. Click the Select Field button to display the Select Query Column section.

    2. Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

  11. Optionally, define the map columns in the Map URL to Query Columns section.

    1. Click the Map Columns button to map the drilling URL to a source query selected column.

    2. Select appropriate values from the Map URL to Query Columns section.

  12. Click the OK button.

    The Edit Expression Properties page appears with a component drilling URL in the Expression Text field.

    This is an example of a component drilling URL:

    '/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=A.DEPTID&SETID=A.SETID:A.SETID: A.DEPTID'

    In this example, the standard query URL format is:

    /c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=A.DEPTID&SETID=A.SETID

    and the binding columns is A.SETID:A.DEPTID. Thus, this drilling URL is binding with column A.DEPTID and A.SETID.

    Note that, a component drilling URL:

  13. Save your query.

  14. Select Reporting Tools, Query, Query Manager.

    Alternatively, select Reporting Tools, Query, Query Viewer.

  15. Click the HTML link or the Download to Excel link.

    The query results page displays results as links. When you click these links, destination query is run using the prompt key value that is defined using the source query.

Click to jump to top of pageClick to jump to parent topicDefining External URL Widgets

The External URL widget enables you to use the Enter an External URL page to build drilling URLs in an external URL format; when you click the External URL link in the Edit Expression Properties page to access the Enter an External URL page, you are directed to an external page.

To access the Enter an External URL page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

  3. If you create a new query, click the Search button and click the Add Record link to select a record for the query.

  4. Select the Expressions tab.

  5. Click the Add Expression button.

    The Edit Expression Properties page appears.

  6. Select the Drilling URL option from the Expression Type list.

  7. Click the External URL link.

    The Enter an External URL page appears.

This is an example of the Enter an External URL page:

Note. Query URL and component URL have a certain format for key list values in the URL. However, external URL has no key mapping widget because external URL is free-format URL.

External URL

Enter the value of the external URL.

Note. There is no format restriction.

Map Columns

After you enter URL value, click this button to display the Map URL to Query Columns section.

Note. This step is required for the drilling URLs to be available in the query results page.

You can define multiple drilling URLs in a query, but each query result column can only bind with one URL. When you click the Map Column button, only those fields that have no bond with any URL appear in the Map URL to Query Columns section. If all query columns have bonds with other tracking URLs, then a message appears saying “All columns have already been mapped to other drilling URLs.”

Select Field

Click to display the Select Query Column section.

See Selecting Query Columns for Existing Drilling URLs.

Select Query Column

Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

See Modify Existing Drilling URLs at Runtime.

Map URL to Query Columns

The Map URL to Query Columns section is available only after you define the component values and click the Map Columns button.

Note. This step is required for the drilling URLs to be available in query results page.

Use the Map Columns button for binding source query result column fields with a Drilling URL. You must map URL to query result columns in order for the drilling URLs to be available as links in column fields of source query results. You can define column mapping by selecting an appropriate check box in this Map URL to Query Columns section.

OK

Click to complete defining External URL widget and return to the Edit Expression Properties page.

Steps Used to Enter External URLs to Build Drilling URLs

To enter an external URL to build drilling URLs:

  1. Select Reporting Tools, Query, Query Manager.

    The Query Manager search page appears.

  2. Click the Create New Query link on the Query Manager search page to create a source query, or click the Search button and open an existing one.

  3. If you create a new source query, click the Search button and click the Add Record link to select a record for the query.

    The Fields page appears.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list.

  6. Click the External URL link to define drilling URL for the source query that you just created.

    The Enter an External URL page appears.

  7. Type a valid URL in the External URL edit box.

  8. Optionally, define query result columns for existing drilling URLs:

    1. Click the Select Field button to display the Select Query Column section.

    2. Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

  9. Optionally, define the column mapping in the Map URL to Query Columns section.

    1. Click the Map Columns button to map the drilling URL to source query selected column.

    2. Select appropriate values from the Map URL to Query Columns section.

  10. Click the OK button.

    The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.

    An external drilling URL always begins with '/e/. For example: '/e/?url=[http://www.yahoo.com]:A.EFFDT.

  11. Save your query.

  12. Select Reporting Tools, Query, Query Manager.

    Alternatively, select Reporting Tools, Query, Query Viewer.

  13. Click the HTML link or the Download to Excel link.

    The query results page displays results as links. When you click these links, destination query is run using prompt key value that is defined using the source query.

Click to jump to top of pageClick to jump to parent topicDefining Attachment URL Widgets

The Attachment URL widget enables you to use the Enter an Attachment URL page to build drilling URLs in an attachment URL format.

Note. Currently, PeopleTools supports attachment drilling URLs for SES (Security Enterprise Search). If you use SEC and belong to theHTTP File View role, you can view the attachment URL file. Otherwise, a message appears that says you are not authorized for viewing attachments from database using HTTP.

To access the Enter an Attachment URL page:

  1. Select Reporting Tools, Query, Query Manager.

  2. Click the Create New Query link on the Query Manager search page, or click the Search button and open an existing one.

  3. If you create a new query, click the Search button and click the Add Record link to select a record for the query.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list, and click the Attachment URL link.

    The Enter an Attachment URL page appears.

This is an example of the Enter an Attachment URL page:

URL Type

Available options are Internal URL and External URL.

URL ID

Select a query field that will be used for attachment file name.

Note. The URL IDs are set in this folder: PeopleTools\Utilities\Administration\URLs.

Select Field

Click to display the Select Query Column section.

Map Columns

After you enter URL value, click this button to display the Map URL to Query Columns section.

Note. This step is required for the drilling URLs to be available in the query results page.

You can define multiple drilling URLs in a query, but each query result column can only bind with one URL. When you click the Map Column button, only those fields that have no bond with any URL appear in the Map URL to Query Columns section. If all query columns have bonds with other tracking URLs, then a message appears saying “All columns have already been mapped to other drilling URLs.”

Select Query Column

Select query result columns to form field name and value pairs and to define the order of the appended value pair in the URL.

Map URL to Query Columns

This section is available only after you define the component values and click the Map Columns button.

Note. This step is required for the drilling URLs to be available in query results page.

Use the Map Columns button for binding source query result column fields with a Drilling URL. You must map URL to query result columns in order for the drilling URLs to be available as links in column fields of source query results. You can define column mapping by selecting an appropriate check box in this Map URL to Query Columns section.

OK

Click to complete defining External URL widget and return to the Edit Expression Properties page.

Steps Used to Enter Attachment URLs to Build Drilling URLs

To enter an attachment URL to build drilling URLs:

  1. Select Reporting Tools, Query, Query Manager.

    The Query Manager search page appears.

  2. Click the Create New Query link on the Query Manager search page to create a source query, or click the Search button and open an existing one.

  3. If you create a new source query, click the Search button and click the Add Record link to select a record for the query.

    The Fields page appears.

  4. Select the Expressions tab, and click the Add Expression button.

    The Edit Expression Properties page appears.

  5. Select the Drilling URL option from the Expression Type list.

  6. Click the Attachment URL link to define drilling URL for the source query that you just created.

    The Enter an Attachment URL page appears.

  7. Select an URL type, an URL ID, and a file name field.

  8. Optionally, define query result columns for existing drilling URLs:

    1. Click the Select Field button to display the Select Query Column section.

    2. Select query result columns to form fieldname and value pairs and to define the order of the appended value pair in the URL.

  9. Optionally, define the column mapping in the Map URL to Query Columns section.

    1. Click the Map Columns button to map the drilling URL to source query selected column.

    2. Select appropriate values from the Map URL to Query Columns section.

  10. Click the OK button.

    The Edit Expression Properties reappears with query drilling URLs in the Expression Text field.

  11. Save your query.

Click to jump to top of pageClick to jump to parent topicQuerying Results with Drilling URLs

When you access the Run page of a query that has a Drilling URL defined, its query results are shown as links. Clicking these result links either:

This is an example of the Run page with query results as links:

On the Run page, when you click the Download to Excel link to download query results to a Microsoft Excel spreadsheet, an Excel spreadsheet is launched with links to respective cells. When you click the Excel link from Query Manager or the Query Viewer search results page, you get similar query results.

This is an example of query results in Microsoft Excel when you click the Excel link in Query Manager or Query Viewer. Note that the URL appears when you hover the mouse over a cell:

You can also view the query results of a query that has drilling URL defined using the HTML links in Query Manager or Query Viewer.

This is an example of query results as links when you click the HTML links in Query Manager or Query Viewer:

In this query result page:

This is an example of CSV file content:

"QEDM1","10900","10900","http://buffy-lap1.peoplesoft.com:8080/psp/ps_2/EMPLOYEE /QE_LOCAL/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=10900&SETID=QEDM1”

Click to jump to top of pageClick to jump to parent topicScheduling Queries with Drilling URLs

The Schedule Query page has five different output types: HTM, PDF, TXT, XLS, and XML. Result files from a successful schedule query run contain links for respective columns using HTM, PDF, and XLS formats.

This is an example of query results in PDF format. Note that the URL appears when you hover the mouse over a cell:

If drilling URL is defined in the query, then no links exist in the result file for TXT and XML formats. However, if you select drilling URLs as a query selected field, drilling URLs are shown in a fully expanded version.

This is an example of TXT file content:

"QEDM1","10900","10900","http://buffy-lap1.peoplesoft.com:8080/psp/ps_2/EMPLOYEE /QE_LOCAL/c/QE_SAMPLE_APPS.QE_DEPT_TBL.GBL?Action=U&DEPTID=10900&SETID=QEDM1

Note. Theoretically, one query can have multiple drilling URLs defined; however, the number of URLs for each query should be limited to enhance performance. For queries that return a large number of results, having multiple URLs defined would slow query execution time.