0% found this document useful (0 votes)
68 views

Basic Query For PS Financials v9.0

This document provides a training guide for using the Query Manager in PeopleSoft Financials. It contains 7 modules that introduce key concepts for building queries such as introducing the Query Manager user interface, working with public queries, building basic queries, entering selection criteria, and joining records. The modules follow a pattern of lessons containing explanatory text and practices or exercises for students to complete.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Basic Query For PS Financials v9.0

This document provides a training guide for using the Query Manager in PeopleSoft Financials. It contains 7 modules that introduce key concepts for building queries such as introducing the Query Manager user interface, working with public queries, building basic queries, entering selection criteria, and joining records. The modules follow a pattern of lessons containing explanatory text and practices or exercises for students to complete.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 191

Basic Query for

PeopleSoft Financials
Training Participant Guide

Version 9.0
Feb 2009
Table of Contents
Before you begin… ....................................................................... vii
Intended Audience .................................................................................................... vii
How This Guide Is Organized ................................................................................... vii
Symbols and Conventions ....................................................................................... viii

Module 1 Introducing the Query Manager ................................. 1-1


Lesson 1: Course Overview.................................................................................... 1-2
Agenda ............................................................................................... 1-2
Course Objectives .............................................................................. 1-3
Module Structure ................................................................................ 1-3

Lesson 2: Overview of Query Tables ...................................................................... 1-4


Relational Databases ......................................................................... 1-4
What is a Table?................................................................................. 1-5
Retrieving Data from the Database .................................................... 1-5

Lesson 3: Introducing the Query Manager.............................................................. 1-6


Practice – Opening an Existing Query................................................ 1-7
The Query Component ....................................................................... 1-9

Review Questions: ................................................................................................ 1-21

Module 2 Working with Public Queries...................................... 2-1


Lesson 1: Running Queries from the Query Manager............................................. 2-2
Practice – Running a Query without Prompts ..................................... 2-2
Practice – Running a Query with Prompts .......................................... 2-4

Lesson 2: Sending Report Results to Excel ............................................................ 2-6


Practice – Sending Query Results to an Excel Spreadsheet .............. 2-6

2/24/2009 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. iii


Table of Contents Basic Query for PeopleSoft Financials 8.4

Lesson 3: Adding and Deleting Fields .................................................................... 2-9


Practice – Adding a Field to a Query.................................................. 2-9
Practice – Deleting a Field from a Query.......................................... 2-12

Lesson 4: Performing File Functions .................................................................... 2-13


Practice – Saving Changes to a Query ............................................ 2-13
Practice – Cloning a Query .............................................................. 2-14
Practice – Renaming a Query .......................................................... 2-15
Practice – Closing a Query............................................................... 2-16
Practice – Deleting a Query ............................................................. 2-17

Review Questions:................................................................................................ 2-18

Module 3 Building Basic Queries ............................................... 3-1


Lesson 1: Query Overview ..................................................................................... 3-2
Steps to Create a Query..................................................................... 3-2
Effective-dated Records ..................................................................... 3-3

Lesson 2: Building a Simple Query......................................................................... 3-5


Practice – Building a Simple Query .................................................... 3-5

Lesson 3: Formatting a Query .............................................................................. 3-10


Edit Field Properties Page................................................................ 3-10
Reorder/Sort Page ........................................................................... 3-10
Practice – Changing the Column Headings...................................... 3-11
Practice – Changing the Column Order of the Fields ....................... 3-13
Practice – Sorting the Results .......................................................... 3-15
Practice – Displaying a Translate Value........................................... 3-17
Exercise 3-1: Building a Basic Query ............................................... 3-19

Lesson 4: Using Aggregate Functions .................................................................. 3-20


Practice – Adding an Aggregate Function ........................................ 3-20
Exercise 3-2: Using Aggregate Functions ........................................ 3-24

Lesson 5: Using Distinct ....................................................................................... 3-25


Review Questions................................................................................................. 3-26

iv Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2/24/2009


Basic Query for PeopleSoft Financials 8.4 Table of Contents

Module 4 Entering Selection Criteria ......................................... 4-1


Lesson 1: Criteria Overview.................................................................................... 4-2
The Criteria tab................................................................................... 4-2
Adding Fields to the Criteria tab ......................................................... 4-2
Effective-dated Records ..................................................................... 4-4

Lesson 2: Adding Selection Criteria ........................................................................ 4-5


Practice – Adding Selection Criteria ................................................... 4-5
Exercise 4-1: Adding Criteria ............................................................ 4-13

Lesson 3: Using Wildcards ................................................................................... 4-14


Examples.......................................................................................... 4-14
Practice – Using a Wildcard with the ‘like’ Condition Type ............... 4-15

Lesson 4: Grouping Criteria .................................................................................. 4-17


Practice – Grouping Rows of Criteria ............................................... 4-18
Exercise 4-2: Grouping Criteria ........................................................ 4-22

Lesson 5: Building a Criteria List........................................................................... 4-23


Practice – Using the ‘in list’ Condition Type...................................... 4-24

Lesson 6: Using Run-Time Prompts ..................................................................... 4-28


Practice – Setting up a Run-Time Prompt ........................................ 4-29
Practice – Creating Multiple Prompts ............................................... 4-32
Exercise 4-3: Creating Prompts........................................................ 4-34

Lesson 7: Building Prompts from the Prompt page............................................... 4-35


Practice – Creating ‘between’ Prompts............................................. 4-35
Exercise 4-4: Using “in list” with Prompts ......................................... 4-41

Review Questions ................................................................................................. 4-42

Module 5 Joining Records .......................................................... 5-1


Lesson 1: Overview of Joins and Record Relationships ......................................... 5-2
Joining Records.................................................................................. 5-2
Record Relationships ......................................................................... 5-5
Outer Joins ......................................................................................... 5-6

Lesson 2: Joining Hierarchical Records.................................................................. 5-7

2/24/2009 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. v


Table of Contents Basic Query for PeopleSoft Financials 8.4

Practice – Joining Hierarchical Records............................................. 5-8

Lesson 3: Joining Related Records ...................................................................... 5-15


Practice – Joining Records with a Related Record Relationship ...... 5-15
Exercise 5-1: Joining Records.......................................................... 5-19

Review Questions................................................................................................. 5-20

Appendix A Financial Tables ..................................................... A-1


General Ledger Tables ........................................................................................... A-2
Accounts Payable Tables ....................................................................................... A-3
Project Costing Tables............................................................................................ A-4
Asset Management Tables ..................................................................................... A-6
Withholding Tables ................................................................................................. A-8
Purchasing Tables ................................................................................................ A-10
Requisition Tables ................................................................................................ A-12
Receiving Tables .................................................................................................. A-13
Item Tables........................................................................................................... A-15

vi Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2/24/2009


Before you begin…
You will use this guide during class to follow the topics as your instructor
presents them. The instructor may also provide you with additional
materials to support the training outlined in this guide.
After class, use this guide as a reference document for completing tasks
within the PeopleSoft system.

Intended Audience
This guide is intended for personnel who are responsible for entering and
processing data in the PeopleSoft system.
We assume that you are familiar with Microsoft Windows. If you are new to
the Windows environment, you should complete a Windows Tutorial prior
to working in the PeopleSoft environment.

How This Guide Is Organized


This guide is organized into modules and lessons to correspond with the
topics your instructor will cover in class. Each module contains practice
exercises that your instructor will walk you through, and individual
exercises for you to complete on your own. There are review questions at
the end of each module to recap the major points of the module.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. vii


Before you begin PeopleSoft Advanced Payroll 8.4

Symbols and Conventions


The following conventions are used in this guide to help you distinguish
between various types of information:

Element How It Is Used


bold text Command and toolbar buttons that you click.
Text you type.
Menus, text and radio buttons that you select.
Check boxes you turn on or off.
<bold text> Function keys on your keyboard that you press.
Procedural information.

Warnings and cautions that require careful attention.

Term definition—appears in the page margin.

Noteworthy comments or important additional


information—generally about the item immediately
preceeding the note. Appears in the main body of the
document.
Noteworthy comments or important additional
information—generally additional information about a
series of steps or the topic being discussed. Appears in
the page margin.

viii Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Module 1
Introducing the Query Manager
The Query Manager is PeopleSoft’s browser-based report builder. You will
use this to run and create online ad-hoc queries.

Chapter Objectives
This chapter explains:
• The agenda and objectives for this course
• The navigation to PeopleSoft Query 9.0
• Query concepts

Chapter Contents
This chapter contains the following lessons:
Lesson 1: Course Overview.....................................................................1-2
Lesson 2: Overview of Query Tables.......................................................1-4
Lesson 3: Introducing the Query Manager...............................................1-6
Review Questions: .................................................................................1-21

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-1


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Lesson 1:
Course Overview
The guide includes three modules and three appendices:
• Module 1, Introducing the Query Designer, explains the objectives
for the course and provides an agenda for the course. It also provides
a brief overview of the Query tool.
• Module 2, Working with Public Queries, shows you how to run
existing queries and copy existing queries that you can modify.
• Module 3, Building Basic Queries, teaches you how to create new
queries and edit the fields to enhance the output.
• Module 4, Entering Selection Criteria, shows you how to filter the
data retrieved based on user-specified parameters.
• Module 5, Joining Records, explains how to create queries that
retrieve data from multiple tables.
• Appendix A, Financial and SCM Tables, provides a listing of some of
the more commonly used records in the AP, GL, PC, AM, PO, and IN
applications.

Agenda
Following is the one-day agenda for this course:

Morning Introductions
Module 1 – Introducing the Query Designer
Module 2 – Working with Public Queries
Module 3 – Building New Queries
Lunch
Afternoon Module 4 – Entering Selection Criteria
Module 5 – Joining Records
Workshop (if time permits)
Evaluations

1-2 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Course Objectives
The purpose of this course is to provide you with the skills needed to
effectively use PeopleSoft Query to view data stored in the database. This
course teaches you how to:
• Build a basic query using one record, and use joins to perform queries
against multiple records.
• Use the various formatting options available in the query tool including
sorting, using aggregate functions to summarize data, and changing
column headings.
• Build selection criteria into a query to filter the data results.
• View the query results on the screen and in Excel.

Module Structure
Most modules are structured the same way and generally consist of the
following:
You are • Objectives. The objectives are found at the beginning of the module
encouraged to ask and define what you will learn in the module.
your instructor
questions throughout • Lessons. Each module has several lessons that explain the various
the entire course. concepts. Some lessons contain practices and exercises.
ƒ Practices are step-by-step instructions for completing a
procedure that the instructor and class participants walk-through
together.
ƒ Exercises are scenarios for you to work through on your own
during class time.
• Review Questions. You will find review questions at the end of the
module that recap material covered in the module. The answers to the
questions will be discussed among class participants and the
instructor.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-3


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Lesson 2:
Overview of Query Tables
One of the most important features of a system is the ability to access the
data maintained by the system. PeopleSoft Query is a tool that allows you
to select and report on information stored in the PeopleSoft application
tables.
To use PeopleSoft Query for reporting, you must understand the structure
of the database. Knowing which tables to access and how to find them is
the key to building successful queries.

Relational Databases
PeopleSoft’s database is a relational database. This means that data is
broken down into a series of tables. When retrieving data, the system only
accesses the tables that contain the requested data.
You can think of a relational database as a filing cabinet. The filing cabinet
represents the database. The drawers of the cabinet represent data files
or tables, while individual forms represent data records or rows.

To effectively use PeopleSoft for reporting purposes, you must understand


the table structure of the database. Understanding where and how data is
maintained on the database makes the process of building a report much
easier.
When you create a query, the components of that query definition are
stored in PeopleSoft Tools tables. Therefore, you can only work with your
queries within PeopleSoft.

1-4 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

What is a Table?
In a relational database, tables are used to store information. This
information is stored in a format that is similar to a spreadsheet. The table
The tables consists of a series of columns and rows. The columns represent the fields
that you will use most
on the various pages in the system. The rows represent the actual data on
often in your queries are
listed in Appendix A, those pages.
Financial Tables. This is a partial example of the Vendor table:

Vendor Table

Field Names
SETID VENDOR_ID NAME VENDOR VENDOR
STATUS CLASS
HC 0000000001 Western Telephone Approved Outside Party
MFG 0000000001 Superior Research Approved Outside Party
Records
MFG 0000000022 DeVille Enterprises Approved Outside Party
MFG 0000001200 Blue River Supplies Approved Outside Party

Each table in the database contains unique data, data that is not available
in any other table. Therefore, it only needs to be maintained in one place
but can be accessed from places in the application.

Each table consists of several records. Therefore, the terms “table”


and “records” are often used interchangeably.

Retrieving Data from the Database


Query is used to retrieve data from the database. You must first select the
table that contains the data fields you want in the query. Next, you select
the fields that should appear in the output. Then you tell the system how
you want that data sorted and displayed. You can also build selection
criteria in your query to filter the data based on parameters that you
define.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-5


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Lesson 3:
Introducing the Query Manager
The Query functions are located on the Reporting Tools menu. The
functions available are:
• Query Manager: Allows you to create, edit, copy, delete, rename,
run, and schedule queries.
• Query Viewer: Allows you to preview a query to see the results but
does not give you ability to edit the query.
• Schedule Query: Allows you to enter a request for the PeopleSoft
Process Scheduler to run a query at a future time in a specified
format.

You can find the Query Manager by following this path:


• Home  Reporting Tools  Query  Query Manager

1-6 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Practice – Opening an Existing Query


Let’s access the Query Manager and review a query previously created.

To open a query:
1. From the PeopleSoft Home page, click Reporting Tools.
The menu group expands.
2. Click Query.
The Query group expands.

3. Click Query Manager.


The Query Manager – Find an Existing Query page appears.

4. Enter the following information in the Search by fields:


• Select Query Name in the first field.
• Type Training in the second field.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-7


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

You can enter the search value in uppercase or lowercase


letters. The system will automatically change your entry to all
uppercase letters when you click Search.

5. Click .
After a few moments of processing, a list of queries meeting the
search criteria appears.

6. Click on the Edit hyperlink for the query


TRAINING_QUERY_VENDORS.
After a few moments of processing, the query opens to the
Fields page. All fields selected to display in the report results
appear in the list.

1-8 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

The Query Component


The Query Manager consists of nine pages. Each of the nine tabs allows
you access to the specified page.

Records
The Records page allows you to search for and select the data that is to
be the basis of your query. You must include records that contain the
fields you want to display in your report results.

Tip
Click the Show Fields hyperlink to open the list of fields. This helps to
determine if the record is the correct one for the query. Click the return
button again to close the list of fields.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-9


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Query
The Query page displays all the fields in the selected records. From here,
you select the fields you want in the query results.
You can add additional records using a hierarchical join and add criteria to
filter your results from this page,

Alias
The first record selected is given the alias of A, the second B, the third C,
and so on. You will see this alias in front of the field name on the Fields
tab.

1-10 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Expressions
The Expressions page allows you to add new expressions or change
existing expressions.
Expressions are Expressions allow you to build new fields and display information not
an advanced Query topic contained in the PeopleSoft database by performing mathematical
and will not be covered in calculations based on existing data.
this course.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-11


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Prompts
The Prompts page allows you to create or edit prompts used in your
query.
Prompts allow you to specify selection criteria values each time you run
the query. For example, you may want to create a query that will retrieve
data for a specific period. A prompt would allow you to enter the date each
time you run the query.

1-12 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Fields
The Fields page shows only the fields selected for this query. It provides
functions for you to edit the appearance of the query and allows you to see
the options currently selected. You can delete fields from the query and
you can add criteria from this page.

Column Description
Col The order in which the field is displayed in the query
results.
Record.Fieldname The field name as it is stored in the database.
Format The format of the field as it is stored in the database.
Ord Indicates a sort order selected by the user, if any.
XLAT Indicates whether the results will contain a description
from the Translate table.
Agg Indicates which, if any, summary function has been
applied to this field.
Heading Text Displays the text that will appear as the column heading
above the query results.
Add Criteria Allows the user to specify criteria for the field.
Edit Allows the user to edit the field properties.
Delete Allows the user to delete the field from the query
results.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-13


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Criteria
The Criteria page allows you to add and delete criteria. This allows you to
narrow the results to only that data meeting the parameters you specify.
This is also referred to as filtering the data.
You can set criteria up as a constant value or you can create prompts that
allow you to specify a value each time you run the query.

1-14 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Having
The Having page allows you to set up criteria on a field to which you’ve
already added an aggregate function.
Adding criteria to
aggregate functions is an
advanced query topic and will An aggregate function causes you to loose the details in favor of
not be covered in this course. summary statistics when the query results are displayed.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-15


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

View SQL
The View SQL page allows you to see the program that runs the query.
While you are creating your query using PeopleSoft’s user-friendly query
application, the program is automatically generating the SQL that is
SQL
stands for Structured necessary for PeopleSoft to run the query.
Query Language.

This information is helpful if it becomes necessary to troubleshoot the


query. You can copy and paste the SQL statements into an email.

Highlight the Query SQL text and right-click to get the “Copy”
command from the menu.

1-16 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Run
The Run page displays the query results.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-17


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Other Commands
You will see a row of query commands across the bottom of most pages.

The commands are described below:

Command Description
Saves the query specifications. It does not save the query
results.

Query: Query names are uppercase and can be up to 30


characters. You cannot have spaces or any special
characters except an underscore.
Description: The description can be up to 30 characters,
mixed case, and can include special characters.
Query Type: Ad-hoc queries from Query Manager are given
a default value of User.
Folder: This designates a folder to save the query in. Users
can create folders for related queries as a means of
grouping.
Owner: Public or Private. Anyone with access to all records
can perform any operation on a public query. Only the user
that created a private query can open, run, modify, or delete
a private query.
Query Definition: User-defined details about the query. For
example, how the query is to be used, or modifications that
were made since the query was originally created.

1-18 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Command Description
Allows you to save an existing query with a new name. This
gives you the ability to copy a public or private query so you
can create a query without starting from scratch.

Takes you to the New Query page to begin to build a new


query. Your current query will be closed.

If you want more than one query open, choose the


link and start a second query in that window.

Allows you to select a name style for displaying records and


fields, and to enable/disable the auto join feature and Auto
Preview feature.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-19


Module 1: Introducing the Query Manager Basic Query for Financials 9.0

Command Description
Information about the query.

Most data is populated from the Save page.

Distinct: When the checkbox is on, the query eliminates


duplicate rows from the results.
Use this option to create a query that contains a union.
Unions allow you to join two similar queries and display the
results in a single output. This is an advanced query feature
and not commonly used.

To navigate within the union, select .


This will allow you to select items from either portion.

1-20 Proprietary and Confidential to Drummond Company, Inc. 02/20/09


Basic Query for Financials 9.0 Module 1: Introducing the Query Manager

Review Questions:

1. What PeopleSoft function is used to run and create queries?

2. Name as many of the nine query pages (tabs) as you can.

02/20/09 Proprietary and Confidential to Drummond Company, Inc. 1-21


Module 2
Working with Public Queries
A query is designated as Public or Private. Any user with access to all
records used for the query can run a public query. Only the owner of the
query can run a private query.

Chapter Objectives
This chapter explains:
• How to run a public query
• How to modify a public query
• How to rename a query
• How to delete a query
• How to export query results to Excel

Chapter Contents
This chapter contains the following lessons:
Lesson 1: Running Queries from the Query Manager .............................2-2
Lesson 2: Sending Report Results to Excel.............................................2-6
Lesson 3: Adding and Deleting Fields .....................................................2-9
Lesson 4: Performing File Functions .....................................................2-13
Review Questions: .................................................................................2-18

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-1


Module 2: Working with Public Queries Basic Query for Financials 9.0

Lesson 1:
Running Queries from the Query Manager
The Query Manager search page allows you to find both public and private
queries. In addition to running a public query as it is, you can take it and
modify it to suit your needs. You can preview the query results on the
screen (grid control output) and you can send the data to Excel for further
formatting and analysis.

Practice – Running a Query without Prompts


Let’s access a public query and run it so we can see how the query results
are displayed in PeopleSoft. We will select a query that does not require
the user to specify any values at runtime.

To search for a query:


You can
skip the first two steps 1. From the PeopleSoft Home page, open the Reporting Tools
if the Query Manager menu.
option is already
visible. 2. Open the Query menu.

3. Click Query Manager.


The Query Manager – Find an Existing Query page appears.

2-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

4. Enter the following in the Search by fields:


• Leave Query Name in the first field
• Type TRAINING in the second field
5. Click .
A list of queries meeting the search criteria appears.

To generate query results:


6. Click the HTML hyperlink on the row containing the
TRAINING_QUERY_VENDORS query.
The query results appear in a new browser window.

7. Close the browser window containing the report results.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-3


Module 2: Working with Public Queries Basic Query for Financials 9.0

Practice – Running a Query with Prompts


Let’s run another public query. This time we will select a query that does
filter the query based on parameters entered at runtime.

To search for a query:


1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type TRAINING in the second field
3. Click .
A list of queries meeting the search criteria appears.

To generate query results:


4. Click the HTML hyperlink on the row containing the
TRAINING_QUERY_PO query.
A new browser window opens with a prompt field.

5. Type CMLTD in the Business Unit field.


6. Select a date for the PO Date.

2-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

7. Click .
The query results appear.

8. Close the browser window containing the report results.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-5


Module 2: Working with Public Queries Basic Query for Financials 9.0

Lesson 2:
Sending Report Results to Excel
You may want to send your report results to Excel. This is especially
helpful if:
• You want to manipulate the data or use in another format.
• You want to e-mail results to someone without access to the
PeopleSoft system.
• You want to save the results for further use.
The Excel link does not export your results to an Excel file. Instead, it puts
the results in an Excel-like table. After you get the results in an excel-like
You can use file, you can use the Save As option on the File menu to create an Excel
Crystal Reports to create a file.
report layout that is saved
and allows you to generate
a report using up-to-date
query data. However, you Data in Microsoft Excel is not automatically updated by subsequent
cannot download query queries. If you need updated information, you will need to rerun the query
results to Crystal Reports. and send the data to Excel again.

Practice – Sending Query Results to an


Excel Spreadsheet
Let’s run a query and then download the results to Excel.

To open a query:
1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query Â
The Query Manager – Find an Existing Query page appears.
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type TRAINING in the second field
3. Click .
A list of queries meeting the search criteria appears.

2-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

To save results as an Excel spreadsheet:


4. Click HTML for the TRAINING_QUERY_VENDORS query.
The query results appear in a new browser window.

5. Click Excel Spreadsheet.


A separate window opens with the data in an Excel-like table.

6. Select File  Save As.


The Save As dialog box appears.
7. Enter a file name.
8. Select Microsoft Excel Workbook (*.xls) in the Save as type
field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-7


Module 2: Working with Public Queries Basic Query for Financials 9.0

9. Click Save.
The data is saved in an Excel format.
10. Close the browser window containing the Excel-like table.

2-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

Lesson 3:
Adding and Deleting Fields
An existing query may be very close to what you want with the exception
of a few fields. It is very easy to add and delete fields to modify your
results. You can then save your modified query using a new name,
thereby leaving the original query unchanged.

Adding fields from a table that is not part of an existing query is more
involved and is discussed in the module on Joining Records.

Practice – Adding a Field to a Query


We will add the Vendor ID field to the TRAINING_QUERY_PO query.

To open a query:
1. Click Query Manager.
Peoplesoft Home Â
The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type TRAINING in the second field
3. Click .
A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the TRAINING_QUERY_PO
query.
The query opens to the Fields page. All fields selected to
display in the query results appear in the list.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-9


Module 2: Working with Public Queries Basic Query for Financials 9.0

To add a field:
5. Click on the Query tab.
The Query page appears and all selected fields have a
checkmark.

6. Click the box beside VENDOR_ID to select that field.


A check appears in the box to show the field is selected.
7. Click on the Fields tab.
The Fields page appears. Notice that the field just selected
appears at the bottom of the list.

To see the revised results:


8. Click on the Run tab.
The first time After a few moments of processing, The Preview page appears
you click on the Run tab with the query results. The field you added is shown as the last
the query results are column.
generated automatically. If
you make changes to the
query, you can regenerate
the results by clicking the
Rerun Query link.

2-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

9. Click to close the PeopleSoft Menu so you can view more of


the report without scrolling side to side.
10. Click to redisplay the PeopleSoft menu.
The icon appears
after you close the PeopleSoft
Menu.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-11


Module 2: Working with Public Queries Basic Query for Financials 9.0

Practice – Deleting a Field from a Query


There are two methods for deleting a field. Let’s delete the Vendor ID
Deleting fields column using the Query tab and the PO Status column using the Fields
from a query does not tab.
delete the data from the
database.
To delete a field using the Query tab:
1. Click on the Query tab.
The Query page appears and all selected fields have a
checkmark.
2. Click the box beside the VENDOR_ID field to turn off the check
mark.

To delete a field using the Fields tab:


3. Click on the Fields tab.
The Fields page appears with all currently selected fields.
If you delete a Notice that the JOURNAL_LINE field is no longer listed.
field by mistake, you can
add it back from the Query
tab.

4. Click on the PO_STATUS row.


The field is removed from the Fields page.

To see the revised results:


5. Click on the Run tab.
After a few moments of processing, the new query results are
displayed and the fields you deleted are gone.

We will save the query in the next lesson.

2-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

Lesson 4:
Performing File Functions
In this lesson, we will perform the following functions:
• Save a query
• Clone (copy) a query
• Rename a query
• Delete a query

Practice – Saving Changes to a Query


Use the Save As command to save the query you just created with a
In this class, you
different name so the original query is not changed.
need to include your initials
when entering a query name
to uniquely identify the
queries you create.
To save a query:
1. Click on the Fields tab.
XXX=your initials The Fields page appears.
2. Click Save As.
The save page appears.

The Description
field appears on the search list
with the query name and should
help you make a query selection.
The Query Definition allows a
place to document changes and
additions to the query.

3. Type XXX_TRAINING_QUERY_PO in the Query Name field.


4. Select Private in the Owner field.
5. Type Query changed in class in the Query Definition field.
If you save a query as
both public and private, the 6. Click .
system stores it as two queries
The Fields page appears and the new name is displayed.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-13


Module 2: Working with Public Queries Basic Query for Financials 9.0

Practice – Cloning a Query


Use the Save As command to make a copy of the
TRAINING_QUERY_PO query. Cloning a query is useful if you want to
build a query without starting from scratch—you can open a similar query,
save it with a new name, and then make changes to it.

To copy an existing query:


1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type TRAINING in the second field
3. Click .
A list of queries that meet the criteria appears.
4. Click on the Edit hyperlink for the TRAINING_QUERY_PO
query.
The query opens to the Fields page.
5. Click Save As.
The save page appears.
6. Type XXX_TRAINING_QUERY_PO in the Query Name field.

XXX=your initials
7. Type Copy of TRAINING_QUERY_PO in the Description field.
8. Select Private in the Owner field.
9. Click .
The query is cloned and the original query is closed.

2-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

Practice – Renaming a Query


Now rename the query you just created.

To rename your query:


1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager
2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field

XXX=your initials 3. Click .


A list of queries that meet the criteria appears.

4. Click the checkbox under the Select column on the row


containing your copy of the TRAINING_QUERY_PO query.
5. Click on the Action drop down box and choose Rename
Selected.

6. Click .
The Enter a new name page appears.

7. Type XXX_TRAINING_QUERY_PO_2 in the Query Name field.


8. Click .
The query name is changed.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-15


Module 2: Working with Public Queries Basic Query for Financials 9.0

Practice – Closing a Query


There is not an option to close a query. You can remove a query from the
screen by selecting Query Manager.

To close a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager

2-16 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 2: Working with Public Queries

Practice – Deleting a Query


Now delete the query you just renamed.

To delete a query:
1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager
2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field

XXX=your initials 3. Click .


A list of queries that meet the criteria appears.

4. Click the checkbox under the Select column on the row


containing your copy of the TRAINING_QUERY_PO query.
5. Click on the Action drop down box and choose Delete Selected.

6. Click .
A message appears to verify the deletion.

7. Click to delete the query.


The Query Manager page reappears and the query is no longer
in the Search results list.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 2-17


Module 2: Working with Public Queries Basic Query for Financials 9.0

Review Questions:

1. How do you make a copy of an existing query?

2. Who can delete a public query?

3. Which page is used to add fields to the query?

4. What is shown on the Fields page?

5. How do you add information about why the query was created or who authored the
query?

2-18 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Module 3
Building Basic Queries
Now that you have a basic understanding of the structures supporting the
query process, you are ready to begin building queries.

Module Objectives
This module teaches you how to:
• Build a query from one table
• Format the query results
• Insert an aggregate function
• Turn on the distinct feature

Module Contents
This module contains the following lessons:
Lesson 1: Query Overview.......................................................................3-2
Lesson 2: Building a Simple Query..........................................................3-5
Lesson 3: Formatting a Query ...............................................................3-10
Lesson 4: Using Aggregate Functions ...................................................3-20
Lesson 5: Using Distinct ........................................................................3-25
Review Questions ..................................................................................3-26

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-1


Module 3: Building Basic Queries Basic Query for Financials 9.0

Lesson 1:
Query Overview

Steps to Create a Query


There are six basic steps to building a query.

Step Action
Steps 2-5 1 Select the records you want to use in your query.
can be performed in
any order. 2 Select the fields you want to appear in your query results.
3 Save the query.

Save again after each of the following steps. By saving early


and often, you do not have to start your query from the beginning if
you encounter a problem.

4 Format the query output.


5 Specify criteria to filter the data.
6 Run the query to view the results.

3-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Effective-dated Records
Many of the records that you use to create queries are effective-dated,
allowing the database to contain current, future, and historical data.
When you use an effective-dated record in Query, you can specify a time
frame. For example, if you are interested only in current information, you
can avoid extracting all of the historical and future data from the database.
This message appears when you select records that are effective dated:

Criteria is
discussed in more detail This is the criteria page with effected dated criteria:
in the next module.

The following table lists each option and the results it returns.

Option Result
Effective Date <= Returns rows less than or equal to the specified date.
Effective Date >= Returns rows greater than or equal to the specified date.
Effective Date < Returns rows less than the specified date.
Effective Date > Returns rows greater than the specified date.
When you
choose an effective date First Effective Date Returns the first or oldest row of data for each item.
option, you are entering Last Effective Date Returns the last row of data for each item.
selection criteria. You only
retrieve one row for each
item in the table.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-3


Module 3: Building Basic Queries Basic Query for Financials 9.0

If you select one of the first four options, you also must indicate which date
to use. The following table lists each option and the results it returns.

Option Result
Current Date Uses the current system date.
Constant Uses a date that you specify as a constant or with an SQL expression.
Field Uses the date in a specified field.

3-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Lesson 2:
Building a Simple Query
Remember that there are several steps involved in the process of building
a query. We will begin building a very simple query without any formatting
or criteria. Therefore, we will only complete four of the steps in the query
process:
• Select the records
• Select the fields
• Save the query
• Run the query

Practice – Building a Simple Query


Let’s practice building a simple query. Create a voucher listing that
includes the business unit, voucher ID, invoice ID and date, close status,
entry status, and gross amount for each voucher. To create this query,
access the VOUCHER records.

To select the records:


1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-5


Module 3: Building Basic Queries Basic Query for Financials 9.0

2. Click Create New Query.


The Records page appears.

3. Enter the following in the Search by fields:


• Leave Record Name in the first field
• Type VOUCHER in the second field
4. Click .
The records meeting the search criteria appear in the Search
Results list.

5. Click Add Record beside VOUCHER – AP Voucher Header


Table.
The Query tab is automatically selected.

Notice that an “A” appears


in the Alias column beside the table
name. The system assigns a
different letter to each table that is
selected for the query (the first table
selected is A, the second is B, the
third is C, and so on). Therefore, the
system knows from which record to
extract the fields you select. This
becomes important when you start
joining multiple records.

3-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Now we can select the fields that we want to display in the query results.

To select the fields:


6. Turn on the checkbox for each of the following fields to select
them for the query:
Click to sort • BUSINESS_UNIT
the fields alphabetically.
Click Find to search for a • VOUCHER_ID
field by name. • INVOICE_ID
You can de-select a field by
clicking the checkbox again • INVOICE_DT
to remove the check.
• CLOSE_STATUS
• ENTRY_STATUS
• GROSS_AMT
7. Click on the Fields tab.
After a few moments of processing, the Fields page appears
with a list of the fields selected for the query. A column number
and the table alias to which it belongs precede each field. The
column order is the order in which the fields appear in the query
results.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-7


Module 3: Building Basic Queries Basic Query for Financials 9.0

As you are building a query, it is a good idea to save after each process.

To save a query:
8. Click .
The save page appears.

XXX=your initials 9. Type XXX_TRAINING_QUERY_VOUCHER in the Query field.

In this class, you will always include your initials when


naming objects you create.

Query names are 10. Type Voucher listing in the Description field.
stored with uppercase letters 11. Type QUERY_TRAINING in the Folder field.
regardless of how they are
entered. A Description can 12. Select Private in the Owner field.
contain both uppercase and
lowercase letters. 13. Click .
The query is saved and the Fields page reappears.

3-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Now that you have saved the query, run it and review the output.

To run a query:
14. Before running this query, adding date criteria might be needed
due to the quantity of data in the tables. Click on the Run tab.
After a few moments of processing, The Preview page appears
with the results of the query.

All of the fields that you selected may not be visible. Use
the bottom scroll bar to view the other fields. Use the right scroll
bar to view additional rows of data.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-9


Module 3: Building Basic Queries Basic Query for Financials 9.0

Lesson 3:
Formatting a Query
Query offers several options for formatting the output. You can:
• Change column headers
• Display translate table (XLAT) values instead of codes
• Change the column order
• Specify a sort order

Edit Field Properties Page

Reorder/Sort Page

3-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Practice – Changing the Column Headings


When fields are set up in PeopleSoft, they are given a short name and a
long name. These names are referred to as RFT (Record Field Table)
values. If the short or long RFT value does not effectively describe the
contents of the field, you can change it.

Change the heading for the CLOSE_STATUS field from the short name to
Close Status and the ENTRY_STATUS field from the short name to the
long name.

To change column headings:


1. Click on the Fields tab.
The Fields page appears.

2. Click on the row containing the CLOSE_STATUS field.


The Edit Field Properties page appears.

3. Select the Text radio button in the Heading box.


4. Type Status in the Heading Text field.

5. Click .
The new heading appears in the Heading Text column.

6. Click on the row containing the ENTRY_STATUS field.


The Edit Field Properties page appears.
7. Select the RFT Long radio button in the Heading box.

The Heading Text does not change at this point.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-11


Module 3: Building Basic Queries Basic Query for Financials 9.0

8. Click .
The long heading name appears in the Heading Text column.

Now save the changes and run the query.

To save the query and run it:


9. Click .
The changes to the query are saved.
10. Before running this query, adding date criteria might be needed
due to the quantity of data in the tables. Click on the Run tab.
After a few moments of processing, the new query results are
displayed.

3-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Practice – Changing the Column Order of the


Fields
The fields selected for a query may not be in the order in which you want
them to appear in the results. If necessary, you can easily change the
order of the columns of data.

Currently, the VOUCHER_ID field appears in the second column. Change


it so it appears as the first column.

To change the order of the columns:


1. Click on the Fields tab.
The Fields page appears.
2. Click .
The Edit Field Ordering page appears.

3. Type 1 in the New Column field for VOUCHER_ID.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-13


Module 3: Building Basic Queries Basic Query for Financials 9.0

4. Click .
The column number changes and automatically adjusts the
subsequent columns.

Now save the changes and run the query.

To save the query and run it:


5. Click .
The changes to the query are saved.
6. Before running this query, adding date criteria might be needed
due to the quantity of data in the tables. Click on the Run tab.
After a few moments of processing, the new query results are
displayed.
The results
are sorted by
Business Unit even
though it is not the
first column.

3-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Practice – Sorting the Results


In addition to changing the order of your columns, you can change the
order of the data. Currently, the results are sorted by business unit.
Format this query to sort first by INVOICE_DT and then by GROSS_AMT.

To specify a sort order:


1. Click on the Fields tab.
The Fields page appears.
2. Click .
The Edit Field Ordering page appears.
3. Type 1 in the New Order By field for INVOICE_DT.
4. Type 2 in the New Order By field for GROSS_AMT.
5. Turn on the Descending checkbox for GROSS_AMT.

The default order is always ascending for each field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-15


Module 3: Building Basic Queries Basic Query for Financials 9.0

6. Click .
The Ord column reflects the sort applied to both fields, a 1 for
Invoice Date and a 2D for Gross Invoice Amount.

Now save the changes and run the query.

To save the query and run it:


7. Click .
The changes to the query are saved.
8. Before running this query, adding date criteria might be needed
due to the quantity of data in the tables. Click on the Run tab.
After a few moments of processing, the new query results are
displayed.

3-16 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Practice – Displaying a Translate Value


Some data that you access from a record may be returned as a field code.
You can choose to view a more detailed description of the code by
displaying the translate (XLAT) short or long description. An example of a
field code is “O” for Close Status. By changing the XLAT option to the
short translate value, “Open” would display.

Let’s change the XLAT codes for the CLOSE_STATUS and


ENTRY_STATUS fields to display the short translate values.

To change XLAT options:


1. Click on the Fields tab.
The Fields page appears.

2. Click on the row containing CLOSE_STATUS.


The Edit Field Properties page appears.
3. Select the Short radio button in the Translate Value box.

4. Click .
An S appears in the XLAT column of this field.

5. Click on the row containing the ENTRY_STATUS field.


6. Select the Short radio button in the Translate Value box.

7. Click .
An S appears in the XLAT column of this field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-17


Module 3: Building Basic Queries Basic Query for Financials 9.0

Save the completed query and run it.

To save the query and run it:


8. Click .
The changes to the query are saved.
9. Before running this query, adding date criteria might be needed
due to the quantity of data in the tables. Click on the Run tab.
After a few moments of processing, the new query results are
displayed.

There is not an option to close a query. You can remove a query from the
screen by selecting Query Manager.

To close a query:
10. Click Query Manager.
The Query Manager – Find an Existing Query page appears.

3-18 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Exercise 3-1: Building a Basic Query


In this exercise, create a basic query on your own.
You need a listing of all vendors indicating each vendor’s status and
classification. This list should also identify who entered the vendor into the
system.

Instructions
Use the VENDOR table to create this query.
Include the following fields:
• VENDOR_ID
• NAME1
• VENDOR_STATUS
• VENDOR_CLASS
• ENTERED_BY
Save the query as XXX _VENDORLIST and enter an appropriate
XXX=your initials description.
Change the heading for NAME1 to Vendor Name.
Retrieve the short translate (XLAT) values where possible.
Use the RFT Long headings for the Vendor Status and Vendor
Classification fields.
Sort the results alphabetically by Vendor Name.

Hints
9 Follow this path to the Query Manager:
Home  Reporting Tools  Query  Query Manager
9 After you select the fields, click the Fields tab.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-19


Module 3: Building Basic Queries Basic Query for Financials 9.0

Lesson 4:
Using Aggregate Functions
There may be times when you want only a data summary, not all of the
details. For instance, you may want to know how many vendors you have
in each country without actually listing every vendor.
There are several aggregate functions available in Query.
• Sum adds the values from each row and displays the total
• Count counts the number of rows
• Min checks the value from each row and returns the lowest one
• Max checks the value from each row and returns the highest one
• Average adds the values from each row and divides the result by the
number of rows

Some aggregate functions are not available for some fields.

Practice – Adding an Aggregate Function


Create a query that provides an average general ledger posted total
amount by account. Sort the query in descending order by posted total
amount and use the RFT Long headings for Business Unit and Account.
Run the query both before and after applying the aggregate function so
you can see how an aggregate function changes the output.

To select records and fields:


1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Click Create New Query.
The Records page appears.
3. Enter the following in the Search by fields:
• Leave Record Name in the first field
• Type LEDGER in the second field
4. Click .
The records meeting the search criteria appear in the Search
Results list.

3-20 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

5. Click Add Record beside LEDGER - Ledger Data.


The Query tab is automatically selected.
6. Select the following fields:
• BUSINESS_UNIT
• ACCOUNT
• POSTED_TOTAL_AMT

Save the query and run it.

To save the query and run it:


7. Click .
The save page appears.
XXX=your initials 8. Type XXX_TRAINING_QUERY_LEDGER in the Query field.
9. Type Average posted amt by account in the Description field.
10. Type QUERY_TRAINING in the Folder field.
11. Select Private in the Owner field.

12. Click .
The new query is saved.
13. Before running this query, adding ledger criteria might be
needed due to the quantity of data in the tables. Click on the
Run tab.
The Preview page appears, and after a few moments of
processing, the results of the query are displayed.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-21


Module 3: Building Basic Queries Basic Query for Financials 9.0

Now add an aggregate function that averages the posted total amount.
Sort by that field in descending order.

To add an aggregate function and sort:


14. Click on the Fields tab.

15. Click on the POSTED_TOTAL_AMT row.


The Edit Field Properties page appears.

16. Select the Average radio button in the Aggregate box.

17. Click .
18. Click .
The Edit Field Ordering page appears.
19. Type a 1 in the New Order By field for
POSTED_TOTAL_AMOUNT.
20. Turn on the Descending check box for
POSTED_TOTAL_AMOUNT.
Avg appears in the Agg column of this field. A D1 appears in the
Order column.

3-22 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Change the heading for Business Unit to the RFT Long description.

To change column headings:

21. Click on the BUSINESS_UNIT row.


The Edit Field Properties page appears.
22. Select the RFT Long radio button.

23. Click .
The long heading name appears in the Heading Text column.

Save the completed query and run it.

To save the query and run it:


24. Click .
The changes are saved.
25. Before running this query, adding ledger criteria might be
needed due to the quantity of data in the tables. Click on the
Run tab.
After a few moments of processing, the new results are
displayed.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-23


Module 3: Building Basic Queries Basic Query for Financials 9.0

Exercise 3-2: Using Aggregate Functions


In this exercise, use an aggregate function in a query.
Create a query that displays the number of vendors in each country.

Instructions
Use the VENDOR_ADDR table to create this query.
Include the following fields:
• SETID
• ADDRESS_SEQ_NUM
• VENDOR_ID
• COUNTRY
Save the query as XXX _AGGREGATE.
XXX=your initials
Order by SETID, then ADDRESS_SEQ_NUM.

Hints
9 Add the aggregate function of count to the VENDOR_ID field.

3-24 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 3: Building Basic Queries

Lesson 5:
Using Distinct
Sometimes when running a query, the same row of output is listed more
than once because it satisfies the query criteria in more than one case.
The Distinct button removes duplicate rows of output from the results.
Let’s say you want to know in which countries you currently have vendors.
If you query against the country field of the vendor table, each country that
has more than one vendor will appear multiple times in the results. Using
Distinct, you will see each country only once.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 3-25


Module 3: Building Basic Queries Basic Query for Financials 9.0

Review Questions

1. What are the steps for creating a query?

2. What are some of the formatting options available from the Fields page?

3. How do you sort the field names on the Query tab alphabetically?

4. What are the aggregate functions that may be used in a query?

5. What is the purpose of the Distinct feature?

3-26 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Module 4
Entering Selection Criteria
Now that you have learned how to create basic queries, you are ready to
learn how to filter the data retrieved based on user-specified parameters.

Module Objectives
This module teaches you how to:
• Build parameters that filter the data
• Prompt for criteria values at run time

Module Contents
This module contains the following lessons:
Lesson 1: Criteria Overview.....................................................................4-2
Lesson 2: Adding Selection Criteria.........................................................4-5
Lesson 3: Using Wildcards ....................................................................4-14
Lesson 4: Grouping Criteria ...................................................................4-17
Lesson 5: Building a Criteria List ...........................................................4-23
Lesson 6: Using Run-Time Prompts ......................................................4-28
Lesson 7: Building Prompts from the Prompt page ...............................4-35
Review Questions ..................................................................................4-42

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-1


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 1:
Criteria Overview
If you do not specify selection criteria, you will retrieve every row of data in
a table. To selectively retrieve records, you must define selection criteria,
You can or conditions, that the data must meet in order to be returned in the output.
build selection criteria For example, you may only want a list of invoices for a specific date.
around any field in the You will now use the Criteria tab to identify selection criteria. You can add
record. A field does
as many selection criteria as necessary to achieve the desired output.
not have to appear in
the results to be used
as criteria.
The Criteria tab
On the Criteria tab, each row represents one set of search conditions or
expressions for a field. Below is an example of the Criteria tab with four
rows of criteria.

Adding Fields to the Criteria tab


All criteria that are part of the query appear on the Criteria tab. However,
you can add criteria from three places:
• The Query tab
• The Fields tab
• The Criteria tab

Criteria Icon

The criteria icon appears on the Query tab and the Fields tab beside
each field. Click the icon on the row containing the field on which you want
to add criteria.

4-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Field Descriptions
The columns on the Criteria tab are:

Field Description
Logical A logical expression determines if you want the next line of
criteria to be ‘in addition to’ (AND) or ‘an alternative to’ (OR)
the previous expression. All rows after the first row must
have a value in the Logical field. The default value is AND.
Expression 1 The field on which you want to base your selection criteria.
Condition The available comparison Condition Types are:
Type
• Equal to
• Greater than (not inclusive)
• Less than (not inclusive)
• In list
• Between (inclusive)
• Exists
• Like
• Is Null
• In Tree

A ‘not’ option of each Condition Type listed above is


also available to apply the reverse effect.
Expression 2 The value to which you want to compare the field in
Expression 1. This may be a constant, another field, or a
run-time prompt.
Edit Click to modify the criteria row.
Delete Click to remove the criteria row.

If you are using an effective-dated table, the first criteria row will
specify the date option you chose when you first selected the table. There
are special Condition Types for this function so that only one row is
returned for each item. You can use the standard comparison Condition
Types rather than the effective-date Condition Types if you want to specify
a subset of rows to retrieve.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-3


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Effective-dated Records
Many of the records that you use to create queries are effective-dated,
allowing the database to contain current, future, and historical data.
When you use effective-dated records in Query, you specify a time frame.
For example, if you are interested only in current information, you can
avoid extracting all of the historical and future data from the database.
This message appears when you select records that are effective dated:

This is the criteria page with effected dated criteria:

The following table lists each option and the results it returns.

Option Result
Effective Date <= Returns rows less than or equal to the specified date.
Effective Date >= Returns rows greater than or equal to the specified date.
Effective Date < Returns rows less than the specified date.
Effective Date > Returns rows greater than the specified date.
When you
choose an effective date First Effective Date Returns the first or oldest row of data for each item.
option, you are entering Last Effective Date Returns the last row of data for each item.
selection criteria. You only
retrieve one row for each
item in the table with all
options.
If you select one of the first four options, you also must indicate which date
to use. The following table lists each option and the results it returns.

Option Result
Current Date Uses the current system date.
Constant Uses a date that you specify as a constant or with an SQL expression.
Field Uses the date in a specified field.

4-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 2:
Adding Selection Criteria

Practice – Adding Selection Criteria


Create a query that lists vendors whose vendor status is approved,
classification is outside party, and vendor ID is greater than 4000000500.
The results should contain vendor ID, name, status, and classification.
Sort the query by vendor name and display short translate values.

To select the records:


1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager 2. Click Create New Query.
The Records page appears.

3. Enter the following in the Search by fields:


• Leave Record Name in the first field
• Type VENDOR in the second field

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-5


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

4. Click .
A list of records meeting the search criteria appears.

5. Click Add Record beside VENDOR – Vendor Header Table.


The Query tab is automatically selected.

To select the fields and save the query:


6. Select the following fields:
• SETID
• VENDOR_ID
• NAME1
• VENDOR_STATUS

4-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

• VENDOR_CLASS
7. Click .
The save page appears.
8. Type XXX _TRAINING_QUERY_CRITERIA1 in the Query field.
XXX=your initials 9. Type Vendor List with Criteria in the Description field.
10. Type QUERY_TRAINING in the Folder field.
11. Select Private in the Owner field.

12. Click .
The new query is saved.

Now establish your search criteria for this query. Remember that you only
want to see vendors with a vendor status of approved, a classification of
outside party, and a vendor ID greater than 4000000500. Let’s add criteria
from each of the three places where it is available.

To add criteria from the Query tab:

13. Click on the VENDOR_STATUS row.


The Edit Criteria Properties page appears.

14. Leave the defaults in the Expression 1 Type and Expression 1


boxes.
15. Leave equal to in the Condition Type field.
16. Leave Constant in the Expression 2 Type box.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-7


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

17. Click beside the Constant field.


The Select A Constant page appears.
’Constant’ is the
default for several of the
Condition Types. Use this
option when you want to
specify the value.

18. Click Select Constant on the Approved row.


The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

19. Click .
The Query page reappears.
20. Click on the Criteria tab.
The criteria you just added is shown on the Criteria tab.

21. Click .
The changes to the query are saved.

To add criteria from the Fields tab:


22. Click on the Fields tab.

23. Click on the VENDOR_CLASS row.


The Edit Criteria Properties page appears.
24. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
25. Leave equal to in the Condition Type field.
26. Leave Constant in the Expression 2 Type box.
27. Click beside the Constant field.
The Select A Constant page appears.
28. Click Select Constant on the Outside Party row.

4-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The Edit Criteria Properties page reappears and the value


selected appears in the Constant field.

29. Click .
The Fields page reappears.
30. Click on the Criteria tab.
The new criteria row appears.
The word AND appears
in the Logical field of the criteria
row. This indicates that a row of
data must meet both conditions to
be selected for the output. You
can change the logical from AND
to OR if you want to select rows of
data that meet either condition.

31. Click .
The changes to the query are saved.

Now create the criteria to pull only vendors with a vendor ID greater than
4000000500.

To add criteria from the Criteria tab:


32. Make sure you are on the Criteria tab.
33. Click
The Edit Criteria Properties page appears and the Expression 1
box is blank—there is no field selected.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-9


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

34. Click in the Expression 1 box.


The Select Record and Field page appears.

35. Click A.VENDOR_ID - Vendor ID.


The Edit Criteria Properties page reappears and the Expression
1 field is populated with the field you selected.

36. Select greater than in the Condition Type field.


37. Leave Constant in the Expression 2 Type box.
38. Type 4000000500 in the Constant field.

39. Click .
The new criteria row appears.

4-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

40. Click .
The changes to the query are saved.

Format changes can be made before or after you select the criteria. Sort
this query by Vendor Name and change the XLAT codes for the vendor
status and classification fields to the short translate values.

To format the query:


41. Click on the Fields tab.
The Fields page appears.

42. Click .
The Edit Field Properties page appears.
43. Type 1 in the New Order By field for NAME1.

44. Click .
A 1 appears in the Ord column.

45. Click on the VENDOR_STATUS row.


The Edit Field Properties page appears.
46. Select the Short radio button in the Translate Value box.

47. Click .
An S appears in the XLAT column for the field.

48. Click on the VENDOR_CLASS row.


The Edit Field Properties page appears.
49. Select the Short radio button in the Translate Value box.

50. Click .
An S appears in the XLAT column for the field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-11


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

The query is complete. Now save it and run it.

To save the query and run it:


51. Click .
The changes to the query are saved.
52. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of the query.

4-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Exercise 4-1: Adding Criteria


In this exercise, you will build a query with selection criteria.

Instructions
Create a query that retrieves data for POs in between Jan 2008 through
March 2008, which are in a dispatched status and the PO Type equals
EMER. Also the currency code must be USD.
Use the PO_HDR table and include the following fields:
• BUSINESS_UNIT
• PO_ID
• PO_TYPE
• PO_STATUS
• PO_DT
Save the query as XXX_PO_DATA and enter an appropriate description.
Use Short Translate values for all applicable fields.
XXX=your initials
Sort the results by Business Unit, then PO ID.

Hints
9 You can add criteria on a field that does not appear in your query
results from the Query page.
9 For selected fields, it is easiest to add criteria from the Fields page.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-13


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 3:
Using Wildcards
Whereas the ‘equal to’ Condition Type can only be used when a value
matches exactly, the ‘like’ Condition Type allows you to specify a string
pattern as a comparison value. This means you can select all records that
have a similar value. For example, you could select all accounts that start
with the number 6 without having to enter a range or specify each value
individually.

Wildcards do not work with the ‘equal to’ Condition Type. They only
work with the ‘like’ Condition Type.

The wildcard characters available are:


• Percent sign (%) - represents any number of characters including
none.
• Underscore (_) - represents any single character.
• Any wildcard character that your database software supports.

Examples
61% would retrieve: SMITH% would retrieve
• 61 • SMITH
• 613 • SMITHERS
• 61999999 • SMITHY
• 61A

61_ would retrieve: SMITH_ would retrieve:


• 61 • SMITH
• 613 • SMITHY
• 61A

To use a percent sign or underscore as a literal in your string,


precede the character with a backslash (\).

4-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Practice – Using a Wildcard with the ‘like’


Condition Type
Open the XXX_TRAINING_QUERY_CRITERIA1 query and change the
criteria so that it retrieves all vendors with an ID that begins with 84.

To open a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager
2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field
XXX=your initials 3. Click
A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_CRITERIA1 query.
The Query opens to the Fields page.

Change the criteria so that it retrieves vendor ID’s starting with 84. Since
the vendor ID is several characters long, use the percent sign to represent
the additional characters.

To specify a value with a wildcard:


5. Click on the Criteria tab.
The Criteria page appears.

6. Click on the VENDOR_ID criteria row.


The Edit Criteria Properties page appears.
7. Select like in the Condition Type field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-15


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

8. Type 84% in the Constant field.

9. Click .
The criteria row is changed.

The query is complete. Now save it and run it.

To save the query and run it:


10. Click .
The changes to the query are saved.
11. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of your query.

4-16 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 4:
Grouping Criteria
When using the AND condition and the OR condition to specify criteria, it
may be necessary to group criteria rows with parentheses to get the result
you expect. The rules of logic state that criteria linked with AND are
evaluated before those linked with OR unless the expressions are in
parentheses. Expressions in parentheses are always evaluated first.
Let’s take an example:
Consider the following rows of data:

BU VENDOR VOUCHER DATE AMOUNT


US001 A100 1 03/01/99 800
US001 A100 2 09/05/99 1500
US001 A200 3 05/10/99 600
US002 A100 4 01/25/99 1700
US002 A200 5 10/10/99 1200
US002 A200 6 11/18/99 1100

Now consider the two ways to group three pieces of criteria:


A. (AMOUNT > 1000 OR BU = US001) AND DATE < 06/30/99
B. AMOUNT > 1000 OR (BU = US001 AND DATE < 06/30/99)

Which vouchers would be returned for each statement? The


answers are shown at the bottom of this page.

Even though parentheses are not required, it is a good idea to use


them whenever you have an AND and an OR condition. This way you will
always get the results you desire.

Answers: (A) 1,3,4 (B) 1,2,3,4,5

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-17


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Grouping Rows of Criteria


You want those vouchers that are Postable with an invoice date greater
than 12/01/2008 or those that are open with an invoice date greater than
12/01/2008. You need to group the criteria as follows:
• (Postable OR Open) AND Invoice Date > 12/01/2008

Make a copy of the XXX_TRAINING_QUERY_VOUCHERS query and


enter criteria to retrieve rows based on the above scenario. Save the new
query with a new name.

To clone a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field.
3. Click
XXX=your initials A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
5. Click Save As.
The save page appears.
6. Type XXX_TRAINING_QUERY_CRITERIA2 in the Query field.
7. Type Vouchers with Grouped Criteria in the Description field.
8. Type QUERY_TRAINING in the Folder field.
9. Select Private in the Owner field.

10. Click .
The query is cloned.

4-18 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

First, enter all three criteria rows. Then group the two rows that belong
together.

To enter criteria:

11. Click on the ENTRY_STATUS row.


The Edit Criteria Properties page appears.
12. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
13. Leave equal to in the Condition Type field.
14. Leave Constant in the Expression 2 Type box.
15. Click beside the Constant field.
The Select A Constant page appears.
16. Click Select Constant on the Postable row.
The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

17. Click .
The criteria row is complete.

18. Click on the CLOSE_STATUS row.


The Edit Criteria Properties page appears.
19. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
20. Leave equal to in the Condition Type field.
21. Leave Constant in the Expression 2 Type box.
22. Click beside the Constant field.
The Select A Constant page appears.
23. Click Select Constant on the Open row.
The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

24. Click .
The criteria row is complete

25. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
26. Select greater than in the Condition Type field.
27. Type 12/01/2008 in the Date field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-19


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

28. Click .
The criteria row is complete.

Now change the logical field to OR for the close status criteria row. Then
group the entry status and close status criteria rows.

To change the logical expression and group criteria:


29. Click on the Criteria tab.
The Criteria page appears.
30. Select OR in the Logical field of the CLOSE_STATUS row.

31. Click .
The Edit Criteria Grouping page appears.
32. Use the edit boxes to enter parentheses around the first two
rows as shown below.

33. Click .
The Criteria page reappears and parentheses appear around
the first two rows.

You can group rows within rows by adding additional


parentheses.

4-20 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The query is complete. Now save it and run it.

To save the query and run it:


34. Click .
The changes to the query are saved.
35. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-21


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Exercise 4-2: Grouping Criteria


In this exercise, you will build a query and group selection criteria.

Instructions
Create a query that lists payments made where the amount is greater than
$5,000,000 USD or payments made after January 1, 2008 are greater
than $750,000 USD.
Use the PAYMENT_TBL table for this query. Include the following fields:
• PYMNT_ID
• REMIT_SETID
• REMIT_VENDOR
• NAME1
• PYMNT_DT
• PYMNT_AMT
Save the query as XXX_TRAINING_QUERY_PAYMENTS and enter an
XXX=your initials appropriate description.
Change the PYMNT_DT and REMIT_SETID headings to RFT Long.
Change the NAME1 heading to Vendor Name.
Sort the results by NAME1.
Group the criteria as follows:
• Amount > $5,000,000 OR (Date > 1/1/2008 AND Amount > $750,000)

Hints
9 Use three criteria rows to define the selection criteria. One field can
be used in more than one criteria row.
9 Criteria can be added to the query without being displayed in the
results.

4-22 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 5:
Building a Criteria List
Let’s say that you want to create a list of vendors in a select group of
states. Since the ‘equal to’ Condition Type can only be used with one
value, how can you accomplish this?
You could enter one criteria row for each state and change the logicals to
OR on each row as shown below:

Alternatively, you could build a criteria list as shown below:

Obviously, building a list is quicker and more efficient!

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-23


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Using the ‘in list’ Condition Type


Create a query that lists the most current address for each vendor in the
states of Alabama, Georgia, New York, Texas, Mississippi, and Florida.
Use the VENDOR_ADDR record for this query.

To select records and fields:


1. Click Query Manager.
The Query Manager – Find an Existing Query page appears.
Peoplesoft Home  2. Click Create New Query.
Reporting Tools  Query Â
Query Manager The Records page appears.
3. Enter the following in the Search by fields:
• Leave Record Name in the first field
• Type VENDOR in the second field.
4. Click .
A list of records meeting the search criteria appears.
5. Click Add Record beside VENDOR_ADDR - Vendor Address.
An effective date message appears.

6. Click .
The Query page appears with the selected record.
7. Select the following fields:
• SETID
• VENDOR_ID
• ADDRESS1
• ADDRESS2
• CITY
• STATE
• POSTAL
8. Click .
The save page appears.
9. Type XXX_TRAINING_QUERY_CRITERIA3 in the Query field.
XXX=your initials
10. Type Vendor addresses in the Description field.
11. Type QUERY_TRAINING in the Folder field.

4-24 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

12. Select Private in the Owner field.

13. Click .
The new query is saved.

Enter criteria to select addresses for vendors in the states of Alabama,


Georgia, New York, Texas, Mississippi, and Florida.

To specify criteria using the in-list condition type:

14. Click on the STATE row.


The Edit Criteria Properties page appears.
15. Select in list in the Condition Type field.
16. Leave In List in the Expression 2 Type box.
17. Click in the Expression 2 box.
The Edit List page appears.

18. Type AL in the Value field.

19. Click .
AL is added to the Edit List.
20. Enter the rest of the values the same way.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-25


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

21. Click .
The values selected appear in the Expression 2 box.

22. Click .
The Query page reappears.
23. Click on the Criteria tab.
The Criteria page appears with the selected criteria.

Notice that the first criteria row contains an effective date


expression. There are special Condition Types for specifying the
effective date so only one row is retrieved for each item.

The query is complete. Now save it and run it.

To save the query and run it:


24. Click .
The changes to the query are saved.

4-26 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

25. Click on the Run tab.


After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-27


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 6:
Using Run-Time Prompts
Run-time prompts provide the user submitting the query with the
opportunity to specify a criteria value at run time. Thus, if we add a prompt
on the BUSINESS_UNIT field, we can produce a query for any single
business unit without having to modify the query.
Shown below is an example of a single prompt:

Shown below is an example of multiple prompts:

All prompts appear on the Prompts tab. They are numbered consecutively,
starting with one. Prompt numbers are preceded by a colon (:).

4-28 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Practice – Setting up a Run-Time Prompt


Make a copy of the XXX_TRAINING_QUERY_VOUCHERS query and
name it XXX_TRAINING_QUERY_CRITERIA4. Then modify it to include a
prompt on BUSINESS_UNIT.

To clone a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field.
• Type XXX in the second field.
3. Click
A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
5. Click Save As.
The save page appears.
6. Type XXX_TRAINING_QUERY_CRITERIA4 in the Query field.
7. Type Business Unit Prompt in the Description field.
8. Type QUERY_TRAINING in the Folder field.
9. Select Private in the Owner field.

10. Click .
The query is cloned.

Create a prompt to allow the user to specify a business unit when the
query is run. Change the prompt text so that it displays the phrase, “Which
Business Unit?”

To create a run-time prompt:

11. Click the BUSINESS_UNIT row.


The Edit Criteria Properties page appears.
12. Leave the defaults in the Expression 1 Type and Expression 1
boxes.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-29


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

13. Leave equal to in the Condition Type field.


14. Select Prompt in the Expression 2 Type box.
15. Click New Prompt in the Expression 2 box.
The Edit Prompt Properties page appears.
In most cases, you
will not need to change the
information on this page.

16. Select Text in the Heading Type field.


17. Type Which Business Unit? in the Heading Text field.

This is the prompt that will appear when you run the query.

18. Click .
A :1 appears in the Expression 2 box.

19. Click .

4-30 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The Fields page reappears.


20. Click on the Criteria tab.
The Criteria page appears.
The :1 that appears in
the Expression 2 column identifies
a prompt. You can view prompts
on the Prompt tab.

The query is complete. Now save it and run it.

To save the query and run it:


21. Click .
The changes to the query are saved.
22. Click on the Run tab.
After a few moments of processing, a prompt page appears.
This is the prompt that you just created.

23. Type AP40X in the edit field.

24. Click .
After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-31


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Creating Multiple Prompts


You can also use the prompt feature to prompt on more than one field.
Add an additional prompt for invoice date to this query. Change the prompt
text so that it displays the phrase, “What Invoice Date?”

To add an additional run-time prompt:


1. Click on the Fields tab.
The Fields page appears.

2. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
3. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
4. Leave equal to in the Condition Type field.
5. Select Prompt in the Expression 2 Type box.
6. Click New Prompt in the Expression 2 box.
The Edit Prompt Properties page appears.
’Constant’ is the
default for several of the 7. Select Text in the Heading Type field.
Condition Types. Use this 8. Type What Invoice Date? in the Heading Text field.
option when you want to
specify the value. 9. Click .
A :2 appears in the Expression 2 box.

10. Click .
The Fields page reappears.
11. Click on the Criteria tab.
The Criteria page appears.

4-32 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The query is complete. Now save it and run it.

To save the query and run it:


12. Click .
The changes to the query are saved.
13. Click on the Run tab.
A prompt page appears.

14. Type AP40X in the first field.


15. Type 01/22/2009 in the second field.

16. Click .
After a few moments of processing, The Run page appears with
the results of the query.

Notice that the prompt values are shown between the


page tabs and the query results.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-33


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Exercise 4-3: Creating Prompts


In this exercise, you will create prompts for an existing query.

Instructions
Open the XXX_TRAINING_QUERY_VENDORLIST query, save it as
XXX=your initials XXX_TRAINING_QUERY_PROMPTS and enter an appropriate
description.
Create prompts for SETID and VENDOR_STATUS.
Change the heading text for the prompts to read “Enter SetID” and “Select
Vendor Status.”

Hints
9 A field does not need to be selected on the Fields tab to have criteria.
You can add criteria from the Query tab.
9 To test your query, run it using a setID of DRUMM and a status of
Approved.

4-34 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 7:
Building Prompts from the Prompt page
In order to use prompts with some conditions, the prompts must exist
before the criteria is added.
Some examples are:
• You want to use the “between” condition and prompt for the first and
last date
• You want to use the “in list” condition and prompt for multiple
departments in one query
The Prompt page shows all existing prompts—including those created
while adding criteria—and lets you add additional prompts. Prompts are
numbered consecutively, starting with 1. The prompt number is preceded
by a colon (:).

Practice – Creating ‘between’ Prompts


Build two prompts for the INVOICE_DT field. Then add criteria that uses
the ‘between’ condition to prompt for the first and last date. First, clone the
XXX_TRAINING_QUERY_VOUCHERS query so you don’t have to start
your query from scratch.

To clone a query:
1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field.
• Type XXX in the third field.
.Click .
A list of queries meeting the search criteria appears.
XXX=your initials

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-35


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

3. Click on the Edit hyperlink for the


XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
4. Click Save As.
The save page appears.
5. Type XXX_TRAINING_QUERY_CRITERIA5 in the Query field.
6. Type Voucher Listing with Prompts in the Description field.
7. Type QUERY_TRAINING in the Folder field.
8. Select Private in the Owner field.

9. Click .
The query is cloned.

To create prompts from the Prompt tab:


10. Click on the Prompts tab.
The Prompts page appears.

11. Click .
The Edit Prompt Properties page appears and the field name is
blank.

12. Click under Field Name.


The Select a Prompt Field page appears.

4-36 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

13. Type INVOICE in the blank Search by field.


14. Click .
A list of fields meeting the search criteria appears.
15. Click INVOICE_DT.
The Edit Prompt Properties page reappears and the field
selected is displayed.
16. Select Text in the Heading Type field.
17. Type What is your first date? in the Heading Text field.

18. Click
The Prompts page appears with the new prompt.

19. Repeat these steps to add a second prompt on the same field.
The Heading Text should be What is your last date? for the
second prompt.

To create the between criteria:


20. Click on the Fields tab.
The Fields page appears.

21. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
22. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
23. Select between in the Condition Type field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-37


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

24. Select Expr-Expr in the Expression 2 Type box.


The Expression 2 box changes.

25. Click Add Prompt for the first expression.


The Select a Prompt page appears with a list of available
prompts.

26. Click the first date prompt you created.


:1 appears in the Expression field.
27. Click Add Prompt for the second expression.
The Select a Prompt page appears with a list of available
prompts.

4-38 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

28. Click the second date prompt you created.


:2 appears in the Expression 2 field.

29. Click .
The Fields page reappears.
30. Click on the Criteria tab.
The Criteria page appears and the new criteria is displayed.

The query is complete. Now save it and run it.

To save the query and run it:


31. Click .
The changes to the query are saved.
32. Click on the Run tab.
A prompt page appears.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-39


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

33. Type 01/15/2009 in the first field.


34. Type 01/25/2009 in the second field.

35. Click .
After a few moments of processing, The Run page appears with
the results of the query.

4-40 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Exercise 4-4: Using “in list” with Prompts


In this exercise, you will create multiple prompts on the same field.

Instructions
Open the XXX_TRAINING_QUERY_VOUCHERS query, save it as
XXX=your initials XXX_TRAINING_QUERY_PROMPTS_2, and enter an appropriate
YY=your workstation # description.
Create criteria so that you can enter up to 4 business units at run-time.
Change the heading text for the prompts to read “Enter Business Unit 1-4”.

Hints
9 Create your prompts on the Prompts page before adding the criteria.
9 For the prompt, select BUSINESS_UNIT_AP for the field name.
9 For the prompt, select BUS_UNIT_AP_VW for the prompt table.
9 Create your criteria using the in list condition type.
9 To test your query, run it using the following business units: AP40X,
AP40P, CPLTD, CDLTD

It is not necessary to enter a value in all four prompt fields when you
run the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-41


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Review Questions

1. Where can you see the parameters that filter the query results?

2. What Condition Types are available in query?

3. Why would you use a run-time prompt?

4. When would you use the “in list” condition type?

5. How do you add fields to the Criteria page?

6. If you build criteria for a field, is it necessary for that field to appear in the output?

4-42 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Module 4
Entering Selection Criteria
Now that you have learned how to create basic queries, you are ready to
learn how to filter the data retrieved based on user-specified parameters.

Module Objectives
This module teaches you how to:
• Build parameters that filter the data
• Prompt for criteria values at run time

Module Contents
This module contains the following lessons:
Lesson 1: Criteria Overview.....................................................................4-2
Lesson 2: Adding Selection Criteria.........................................................4-5
Lesson 3: Using Wildcards ....................................................................4-14
Lesson 4: Grouping Criteria ...................................................................4-17
Lesson 5: Building a Criteria List ...........................................................4-23
Lesson 6: Using Run-Time Prompts ......................................................4-28
Lesson 7: Building Prompts from the Prompt page ...............................4-35
Review Questions ..................................................................................4-42

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-1


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 1:
Criteria Overview
If you do not specify selection criteria, you will retrieve every row of data in
a table. To selectively retrieve records, you must define selection criteria,
You can or conditions, that the data must meet in order to be returned in the output.
build selection criteria For example, you may only want a list of invoices for a specific date.
around any field in the You will now use the Criteria tab to identify selection criteria. You can add
record. A field does
as many selection criteria as necessary to achieve the desired output.
not have to appear in
the results to be used
as criteria.
The Criteria tab
On the Criteria tab, each row represents one set of search conditions or
expressions for a field. Below is an example of the Criteria tab with four
rows of criteria.

Adding Fields to the Criteria tab


All criteria that are part of the query appear on the Criteria tab. However,
you can add criteria from three places:
• The Query tab
• The Fields tab
• The Criteria tab

Criteria Icon

The criteria icon appears on the Query tab and the Fields tab beside
each field. Click the icon on the row containing the field on which you want
to add criteria.

4-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Field Descriptions
The columns on the Criteria tab are:

Field Description
Logical A logical expression determines if you want the next line of
criteria to be ‘in addition to’ (AND) or ‘an alternative to’ (OR)
the previous expression. All rows after the first row must
have a value in the Logical field. The default value is AND.
Expression 1 The field on which you want to base your selection criteria.
Condition The available comparison Condition Types are:
Type
• Equal to
• Greater than (not inclusive)
• Less than (not inclusive)
• In list
• Between (inclusive)
• Exists
• Like
• Is Null
• In Tree

A ‘not’ option of each Condition Type listed above is


also available to apply the reverse effect.
Expression 2 The value to which you want to compare the field in
Expression 1. This may be a constant, another field, or a
run-time prompt.
Edit Click to modify the criteria row.
Delete Click to remove the criteria row.

If you are using an effective-dated table, the first criteria row will
specify the date option you chose when you first selected the table. There
are special Condition Types for this function so that only one row is
returned for each item. You can use the standard comparison Condition
Types rather than the effective-date Condition Types if you want to specify
a subset of rows to retrieve.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-3


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Effective-dated Records
Many of the records that you use to create queries are effective-dated,
allowing the database to contain current, future, and historical data.
When you use effective-dated records in Query, you specify a time frame.
For example, if you are interested only in current information, you can
avoid extracting all of the historical and future data from the database.
This message appears when you select records that are effective dated:

This is the criteria page with effected dated criteria:

The following table lists each option and the results it returns.

Option Result
Effective Date <= Returns rows less than or equal to the specified date.
Effective Date >= Returns rows greater than or equal to the specified date.
Effective Date < Returns rows less than the specified date.
Effective Date > Returns rows greater than the specified date.
When you
choose an effective date First Effective Date Returns the first or oldest row of data for each item.
option, you are entering Last Effective Date Returns the last row of data for each item.
selection criteria. You only
retrieve one row for each
item in the table with all
options.
If you select one of the first four options, you also must indicate which date
to use. The following table lists each option and the results it returns.

Option Result
Current Date Uses the current system date.
Constant Uses a date that you specify as a constant or with an SQL expression.
Field Uses the date in a specified field.

4-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 2:
Adding Selection Criteria

Practice – Adding Selection Criteria


Create a query that lists vendors whose vendor status is approved,
classification is outside party, and vendor ID is greater than 4000000500.
The results should contain vendor ID, name, status, and classification.
Sort the query by vendor name and display short translate values.

To select the records:


1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager 2. Click Create New Query.
The Records page appears.

3. Enter the following in the Search by fields:


• Leave Record Name in the first field
• Type VENDOR in the second field

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-5


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

4. Click .
A list of records meeting the search criteria appears.

5. Click Add Record beside VENDOR – Vendor Header Table.


The Query tab is automatically selected.

To select the fields and save the query:


6. Select the following fields:
• SETID
• VENDOR_ID
• NAME1
• VENDOR_STATUS

4-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

• VENDOR_CLASS
7. Click .
The save page appears.
8. Type XXX _TRAINING_QUERY_CRITERIA1 in the Query field.
XXX=your initials 9. Type Vendor List with Criteria in the Description field.
10. Type QUERY_TRAINING in the Folder field.
11. Select Private in the Owner field.

12. Click .
The new query is saved.

Now establish your search criteria for this query. Remember that you only
want to see vendors with a vendor status of approved, a classification of
outside party, and a vendor ID greater than 4000000500. Let’s add criteria
from each of the three places where it is available.

To add criteria from the Query tab:

13. Click on the VENDOR_STATUS row.


The Edit Criteria Properties page appears.

14. Leave the defaults in the Expression 1 Type and Expression 1


boxes.
15. Leave equal to in the Condition Type field.
16. Leave Constant in the Expression 2 Type box.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-7


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

17. Click beside the Constant field.


The Select A Constant page appears.
’Constant’ is the
default for several of the
Condition Types. Use this
option when you want to
specify the value.

18. Click Select Constant on the Approved row.


The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

19. Click .
The Query page reappears.
20. Click on the Criteria tab.
The criteria you just added is shown on the Criteria tab.

21. Click .
The changes to the query are saved.

To add criteria from the Fields tab:


22. Click on the Fields tab.

23. Click on the VENDOR_CLASS row.


The Edit Criteria Properties page appears.
24. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
25. Leave equal to in the Condition Type field.
26. Leave Constant in the Expression 2 Type box.
27. Click beside the Constant field.
The Select A Constant page appears.
28. Click Select Constant on the Outside Party row.

4-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The Edit Criteria Properties page reappears and the value


selected appears in the Constant field.

29. Click .
The Fields page reappears.
30. Click on the Criteria tab.
The new criteria row appears.
The word AND appears
in the Logical field of the criteria
row. This indicates that a row of
data must meet both conditions to
be selected for the output. You
can change the logical from AND
to OR if you want to select rows of
data that meet either condition.

31. Click .
The changes to the query are saved.

Now create the criteria to pull only vendors with a vendor ID greater than
4000000500.

To add criteria from the Criteria tab:


32. Make sure you are on the Criteria tab.
33. Click
The Edit Criteria Properties page appears and the Expression 1
box is blank—there is no field selected.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-9


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

34. Click in the Expression 1 box.


The Select Record and Field page appears.

35. Click A.VENDOR_ID - Vendor ID.


The Edit Criteria Properties page reappears and the Expression
1 field is populated with the field you selected.

36. Select greater than in the Condition Type field.


37. Leave Constant in the Expression 2 Type box.
38. Type 4000000500 in the Constant field.

39. Click .
The new criteria row appears.

4-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

40. Click .
The changes to the query are saved.

Format changes can be made before or after you select the criteria. Sort
this query by Vendor Name and change the XLAT codes for the vendor
status and classification fields to the short translate values.

To format the query:


41. Click on the Fields tab.
The Fields page appears.

42. Click .
The Edit Field Properties page appears.
43. Type 1 in the New Order By field for NAME1.

44. Click .
A 1 appears in the Ord column.

45. Click on the VENDOR_STATUS row.


The Edit Field Properties page appears.
46. Select the Short radio button in the Translate Value box.

47. Click .
An S appears in the XLAT column for the field.

48. Click on the VENDOR_CLASS row.


The Edit Field Properties page appears.
49. Select the Short radio button in the Translate Value box.

50. Click .
An S appears in the XLAT column for the field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-11


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

The query is complete. Now save it and run it.

To save the query and run it:


51. Click .
The changes to the query are saved.
52. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of the query.

4-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Exercise 4-1: Adding Criteria


In this exercise, you will build a query with selection criteria.

Instructions
Create a query that retrieves data for POs in between Jan 2008 through
March 2008, which are in a dispatched status and the PO Type equals
EMER. Also the currency code must be USD.
Use the PO_HDR table and include the following fields:
• BUSINESS_UNIT
• PO_ID
• PO_TYPE
• PO_STATUS
• PO_DT
Save the query as XXX_PO_DATA and enter an appropriate description.
Use Short Translate values for all applicable fields.
XXX=your initials
Sort the results by Business Unit, then PO ID.

Hints
9 You can add criteria on a field that does not appear in your query
results from the Query page.
9 For selected fields, it is easiest to add criteria from the Fields page.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-13


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 3:
Using Wildcards
Whereas the ‘equal to’ Condition Type can only be used when a value
matches exactly, the ‘like’ Condition Type allows you to specify a string
pattern as a comparison value. This means you can select all records that
have a similar value. For example, you could select all accounts that start
with the number 6 without having to enter a range or specify each value
individually.

Wildcards do not work with the ‘equal to’ Condition Type. They only
work with the ‘like’ Condition Type.

The wildcard characters available are:


• Percent sign (%) - represents any number of characters including
none.
• Underscore (_) - represents any single character.
• Any wildcard character that your database software supports.

Examples
61% would retrieve: SMITH% would retrieve
• 61 • SMITH
• 613 • SMITHERS
• 61999999 • SMITHY
• 61A

61_ would retrieve: SMITH_ would retrieve:


• 61 • SMITH
• 613 • SMITHY
• 61A

To use a percent sign or underscore as a literal in your string,


precede the character with a backslash (\).

4-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Practice – Using a Wildcard with the ‘like’


Condition Type
Open the XXX_TRAINING_QUERY_CRITERIA1 query and change the
criteria so that it retrieves all vendors with an ID that begins with 84.

To open a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager
2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field
XXX=your initials 3. Click
A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_CRITERIA1 query.
The Query opens to the Fields page.

Change the criteria so that it retrieves vendor ID’s starting with 84. Since
the vendor ID is several characters long, use the percent sign to represent
the additional characters.

To specify a value with a wildcard:


5. Click on the Criteria tab.
The Criteria page appears.

6. Click on the VENDOR_ID criteria row.


The Edit Criteria Properties page appears.
7. Select like in the Condition Type field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-15


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

8. Type 84% in the Constant field.

9. Click .
The criteria row is changed.

The query is complete. Now save it and run it.

To save the query and run it:


10. Click .
The changes to the query are saved.
11. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of your query.

4-16 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 4:
Grouping Criteria
When using the AND condition and the OR condition to specify criteria, it
may be necessary to group criteria rows with parentheses to get the result
you expect. The rules of logic state that criteria linked with AND are
evaluated before those linked with OR unless the expressions are in
parentheses. Expressions in parentheses are always evaluated first.
Let’s take an example:
Consider the following rows of data:

BU VENDOR VOUCHER DATE AMOUNT


US001 A100 1 03/01/99 800
US001 A100 2 09/05/99 1500
US001 A200 3 05/10/99 600
US002 A100 4 01/25/99 1700
US002 A200 5 10/10/99 1200
US002 A200 6 11/18/99 1100

Now consider the two ways to group three pieces of criteria:


A. (AMOUNT > 1000 OR BU = US001) AND DATE < 06/30/99
B. AMOUNT > 1000 OR (BU = US001 AND DATE < 06/30/99)

Which vouchers would be returned for each statement? The


answers are shown at the bottom of this page.

Even though parentheses are not required, it is a good idea to use


them whenever you have an AND and an OR condition. This way you will
always get the results you desire.

Answers: (A) 1,3,4 (B) 1,2,3,4,5

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-17


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Grouping Rows of Criteria


You want those vouchers that are Postable with an invoice date greater
than 12/01/2008 or those that are open with an invoice date greater than
12/01/2008. You need to group the criteria as follows:
• (Postable OR Open) AND Invoice Date > 12/01/2008

Make a copy of the XXX_TRAINING_QUERY_VOUCHERS query and


enter criteria to retrieve rows based on the above scenario. Save the new
query with a new name.

To clone a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field
• Type XXX in the second field.
3. Click
XXX=your initials A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
5. Click Save As.
The save page appears.
6. Type XXX_TRAINING_QUERY_CRITERIA2 in the Query field.
7. Type Vouchers with Grouped Criteria in the Description field.
8. Type QUERY_TRAINING in the Folder field.
9. Select Private in the Owner field.

10. Click .
The query is cloned.

4-18 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

First, enter all three criteria rows. Then group the two rows that belong
together.

To enter criteria:

11. Click on the ENTRY_STATUS row.


The Edit Criteria Properties page appears.
12. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
13. Leave equal to in the Condition Type field.
14. Leave Constant in the Expression 2 Type box.
15. Click beside the Constant field.
The Select A Constant page appears.
16. Click Select Constant on the Postable row.
The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

17. Click .
The criteria row is complete.

18. Click on the CLOSE_STATUS row.


The Edit Criteria Properties page appears.
19. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
20. Leave equal to in the Condition Type field.
21. Leave Constant in the Expression 2 Type box.
22. Click beside the Constant field.
The Select A Constant page appears.
23. Click Select Constant on the Open row.
The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

24. Click .
The criteria row is complete

25. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
26. Select greater than in the Condition Type field.
27. Type 12/01/2008 in the Date field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-19


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

28. Click .
The criteria row is complete.

Now change the logical field to OR for the close status criteria row. Then
group the entry status and close status criteria rows.

To change the logical expression and group criteria:


29. Click on the Criteria tab.
The Criteria page appears.
30. Select OR in the Logical field of the CLOSE_STATUS row.

31. Click .
The Edit Criteria Grouping page appears.
32. Use the edit boxes to enter parentheses around the first two
rows as shown below.

33. Click .
The Criteria page reappears and parentheses appear around
the first two rows.

You can group rows within rows by adding additional


parentheses.

4-20 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The query is complete. Now save it and run it.

To save the query and run it:


34. Click .
The changes to the query are saved.
35. Click on the Run tab.
After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-21


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Exercise 4-2: Grouping Criteria


In this exercise, you will build a query and group selection criteria.

Instructions
Create a query that lists payments made where the amount is greater than
$5,000,000 USD or payments made after January 1, 2008 are greater
than $750,000 USD.
Use the PAYMENT_TBL table for this query. Include the following fields:
• PYMNT_ID
• REMIT_SETID
• REMIT_VENDOR
• NAME1
• PYMNT_DT
• PYMNT_AMT
Save the query as XXX_TRAINING_QUERY_PAYMENTS and enter an
XXX=your initials appropriate description.
Change the PYMNT_DT and REMIT_SETID headings to RFT Long.
Change the NAME1 heading to Vendor Name.
Sort the results by NAME1.
Group the criteria as follows:
• Amount > $5,000,000 OR (Date > 1/1/2008 AND Amount > $750,000)

Hints
9 Use three criteria rows to define the selection criteria. One field can
be used in more than one criteria row.
9 Criteria can be added to the query without being displayed in the
results.

4-22 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 5:
Building a Criteria List
Let’s say that you want to create a list of vendors in a select group of
states. Since the ‘equal to’ Condition Type can only be used with one
value, how can you accomplish this?
You could enter one criteria row for each state and change the logicals to
OR on each row as shown below:

Alternatively, you could build a criteria list as shown below:

Obviously, building a list is quicker and more efficient!

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-23


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Using the ‘in list’ Condition Type


Create a query that lists the most current address for each vendor in the
states of Alabama, Georgia, New York, Texas, Mississippi, and Florida.
Use the VENDOR_ADDR record for this query.

To select records and fields:


1. Click Query Manager.
The Query Manager – Find an Existing Query page appears.
Peoplesoft Home  2. Click Create New Query.
Reporting Tools  Query Â
Query Manager The Records page appears.
3. Enter the following in the Search by fields:
• Leave Record Name in the first field
• Type VENDOR in the second field.
4. Click .
A list of records meeting the search criteria appears.
5. Click Add Record beside VENDOR_ADDR - Vendor Address.
An effective date message appears.

6. Click .
The Query page appears with the selected record.
7. Select the following fields:
• SETID
• VENDOR_ID
• ADDRESS1
• ADDRESS2
• CITY
• STATE
• POSTAL
8. Click .
The save page appears.
9. Type XXX_TRAINING_QUERY_CRITERIA3 in the Query field.
XXX=your initials
10. Type Vendor addresses in the Description field.
11. Type QUERY_TRAINING in the Folder field.

4-24 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

12. Select Private in the Owner field.

13. Click .
The new query is saved.

Enter criteria to select addresses for vendors in the states of Alabama,


Georgia, New York, Texas, Mississippi, and Florida.

To specify criteria using the in-list condition type:

14. Click on the STATE row.


The Edit Criteria Properties page appears.
15. Select in list in the Condition Type field.
16. Leave In List in the Expression 2 Type box.
17. Click in the Expression 2 box.
The Edit List page appears.

18. Type AL in the Value field.

19. Click .
AL is added to the Edit List.
20. Enter the rest of the values the same way.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-25


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

21. Click .
The values selected appear in the Expression 2 box.

22. Click .
The Query page reappears.
23. Click on the Criteria tab.
The Criteria page appears with the selected criteria.

Notice that the first criteria row contains an effective date


expression. There are special Condition Types for specifying the
effective date so only one row is retrieved for each item.

The query is complete. Now save it and run it.

To save the query and run it:


24. Click .
The changes to the query are saved.

4-26 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

25. Click on the Run tab.


After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-27


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Lesson 6:
Using Run-Time Prompts
Run-time prompts provide the user submitting the query with the
opportunity to specify a criteria value at run time. Thus, if we add a prompt
on the BUSINESS_UNIT field, we can produce a query for any single
business unit without having to modify the query.
Shown below is an example of a single prompt:

Shown below is an example of multiple prompts:

All prompts appear on the Prompts tab. They are numbered consecutively,
starting with one. Prompt numbers are preceded by a colon (:).

4-28 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Practice – Setting up a Run-Time Prompt


Make a copy of the XXX_TRAINING_QUERY_VOUCHERS query and
name it XXX_TRAINING_QUERY_CRITERIA4. Then modify it to include a
prompt on BUSINESS_UNIT.

To clone a query:
1. Click Query Manager.
Peoplesoft Home  The Query Manager – Find an Existing Query page appears.
Reporting Tools  Query Â
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field.
• Type XXX in the second field.
3. Click
A list of queries meeting the search criteria appears.
4. Click on the Edit hyperlink for the
XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
5. Click Save As.
The save page appears.
6. Type XXX_TRAINING_QUERY_CRITERIA4 in the Query field.
7. Type Business Unit Prompt in the Description field.
8. Type QUERY_TRAINING in the Folder field.
9. Select Private in the Owner field.

10. Click .
The query is cloned.

Create a prompt to allow the user to specify a business unit when the
query is run. Change the prompt text so that it displays the phrase, “Which
Business Unit?”

To create a run-time prompt:

11. Click the BUSINESS_UNIT row.


The Edit Criteria Properties page appears.
12. Leave the defaults in the Expression 1 Type and Expression 1
boxes.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-29


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

13. Leave equal to in the Condition Type field.


14. Select Prompt in the Expression 2 Type box.
15. Click New Prompt in the Expression 2 box.
The Edit Prompt Properties page appears.
In most cases, you
will not need to change the
information on this page.

16. Select Text in the Heading Type field.


17. Type Which Business Unit? in the Heading Text field.

This is the prompt that will appear when you run the query.

18. Click .
A :1 appears in the Expression 2 box.

19. Click .

4-30 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The Fields page reappears.


20. Click on the Criteria tab.
The Criteria page appears.
The :1 that appears in
the Expression 2 column identifies
a prompt. You can view prompts
on the Prompt tab.

The query is complete. Now save it and run it.

To save the query and run it:


21. Click .
The changes to the query are saved.
22. Click on the Run tab.
After a few moments of processing, a prompt page appears.
This is the prompt that you just created.

23. Type AP40X in the edit field.

24. Click .
After a few moments of processing, The Run page appears with
the results of the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-31


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Practice – Creating Multiple Prompts


You can also use the prompt feature to prompt on more than one field.
Add an additional prompt for invoice date to this query. Change the prompt
text so that it displays the phrase, “What Invoice Date?”

To add an additional run-time prompt:


1. Click on the Fields tab.
The Fields page appears.

2. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
3. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
4. Leave equal to in the Condition Type field.
5. Select Prompt in the Expression 2 Type box.
6. Click New Prompt in the Expression 2 box.
The Edit Prompt Properties page appears.
’Constant’ is the
default for several of the 7. Select Text in the Heading Type field.
Condition Types. Use this 8. Type What Invoice Date? in the Heading Text field.
option when you want to
specify the value. 9. Click .
A :2 appears in the Expression 2 box.

10. Click .
The Fields page reappears.
11. Click on the Criteria tab.
The Criteria page appears.

4-32 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

The query is complete. Now save it and run it.

To save the query and run it:


12. Click .
The changes to the query are saved.
13. Click on the Run tab.
A prompt page appears.

14. Type AP40X in the first field.


15. Type 01/22/2009 in the second field.

16. Click .
After a few moments of processing, The Run page appears with
the results of the query.

Notice that the prompt values are shown between the


page tabs and the query results.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-33


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Exercise 4-3: Creating Prompts


In this exercise, you will create prompts for an existing query.

Instructions
Open the XXX_TRAINING_QUERY_VENDORLIST query, save it as
XXX=your initials XXX_TRAINING_QUERY_PROMPTS and enter an appropriate
description.
Create prompts for SETID and VENDOR_STATUS.
Change the heading text for the prompts to read “Enter SetID” and “Select
Vendor Status.”

Hints
9 A field does not need to be selected on the Fields tab to have criteria.
You can add criteria from the Query tab.
9 To test your query, run it using a setID of DRUMM and a status of
Approved.

4-34 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Lesson 7:
Building Prompts from the Prompt page
In order to use prompts with some conditions, the prompts must exist
before the criteria is added.
Some examples are:
• You want to use the “between” condition and prompt for the first and
last date
• You want to use the “in list” condition and prompt for multiple
departments in one query
The Prompt page shows all existing prompts—including those created
while adding criteria—and lets you add additional prompts. Prompts are
numbered consecutively, starting with 1. The prompt number is preceded
by a colon (:).

Practice – Creating ‘between’ Prompts


Build two prompts for the INVOICE_DT field. Then add criteria that uses
the ‘between’ condition to prompt for the first and last date. First, clone the
XXX_TRAINING_QUERY_VOUCHERS query so you don’t have to start
your query from scratch.

To clone a query:
1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager 2. Enter the following in the Search by fields:
• Leave Query Name in the first field.
• Type XXX in the third field.
.Click .
A list of queries meeting the search criteria appears.
XXX=your initials

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-35


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

3. Click on the Edit hyperlink for the


XXX_TRAINING_QUERY_VOUCHERS query.
The query opens to the Fields page.
4. Click Save As.
The save page appears.
5. Type XXX_TRAINING_QUERY_CRITERIA5 in the Query field.
6. Type Voucher Listing with Prompts in the Description field.
7. Type QUERY_TRAINING in the Folder field.
8. Select Private in the Owner field.

9. Click .
The query is cloned.

To create prompts from the Prompt tab:


10. Click on the Prompts tab.
The Prompts page appears.

11. Click .
The Edit Prompt Properties page appears and the field name is
blank.

12. Click under Field Name.


The Select a Prompt Field page appears.

4-36 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

13. Type INVOICE in the blank Search by field.


14. Click .
A list of fields meeting the search criteria appears.
15. Click INVOICE_DT.
The Edit Prompt Properties page reappears and the field
selected is displayed.
16. Select Text in the Heading Type field.
17. Type What is your first date? in the Heading Text field.

18. Click
The Prompts page appears with the new prompt.

19. Repeat these steps to add a second prompt on the same field.
The Heading Text should be What is your last date? for the
second prompt.

To create the between criteria:


20. Click on the Fields tab.
The Fields page appears.

21. Click on the INVOICE_DT row.


The Edit Criteria Properties page appears.
22. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
23. Select between in the Condition Type field.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-37


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

24. Select Expr-Expr in the Expression 2 Type box.


The Expression 2 box changes.

25. Click Add Prompt for the first expression.


The Select a Prompt page appears with a list of available
prompts.

26. Click the first date prompt you created.


:1 appears in the Expression field.
27. Click Add Prompt for the second expression.
The Select a Prompt page appears with a list of available
prompts.

4-38 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

28. Click the second date prompt you created.


:2 appears in the Expression 2 field.

29. Click .
The Fields page reappears.
30. Click on the Criteria tab.
The Criteria page appears and the new criteria is displayed.

The query is complete. Now save it and run it.

To save the query and run it:


31. Click .
The changes to the query are saved.
32. Click on the Run tab.
A prompt page appears.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-39


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

33. Type 01/15/2009 in the first field.


34. Type 01/25/2009 in the second field.

35. Click .
After a few moments of processing, The Run page appears with
the results of the query.

4-40 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 4: Entering Selection Criteria

Exercise 4-4: Using “in list” with Prompts


In this exercise, you will create multiple prompts on the same field.

Instructions
Open the XXX_TRAINING_QUERY_VOUCHERS query, save it as
XXX=your initials XXX_TRAINING_QUERY_PROMPTS_2, and enter an appropriate
YY=your workstation # description.
Create criteria so that you can enter up to 4 business units at run-time.
Change the heading text for the prompts to read “Enter Business Unit 1-4”.

Hints
9 Create your prompts on the Prompts page before adding the criteria.
9 For the prompt, select BUSINESS_UNIT_AP for the field name.
9 For the prompt, select BUS_UNIT_AP_VW for the prompt table.
9 Create your criteria using the in list condition type.
9 To test your query, run it using the following business units: AP40X,
AP40P, CPLTD, CDLTD

It is not necessary to enter a value in all four prompt fields when you
run the query.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 4-41


Module 4: Entering Selection Criteria Basic Query for Financials 9.0

Review Questions

1. Where can you see the parameters that filter the query results?

2. What Condition Types are available in query?

3. Why would you use a run-time prompt?

4. When would you use the “in list” condition type?

5. How do you add fields to the Criteria page?

6. If you build criteria for a field, is it necessary for that field to appear in the output?

4-42 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Module 5
Joining Records
There are several types of joins in query. Joins that consist of tables with a
known relationship are simple because the process is just a matter of
selecting the tables. On the other hand, if you want to join tables that are
not related, the process is more complex because you must identify and
join the tables on their common fields. In this module, you are introduced
to the various types of joins and you learn to create one query that
contains data from multiple related tables.

Module Objectives
This module teaches you how to:
• Distinguish between the different types of joins
• Join records with an established relationship

Module Contents
This module contains the following lessons:
Lesson 1: Overview of Joins and Record Relationships..........................5-2
Lesson 2: Joining Hierarchical Records...................................................5-7
Lesson 3: Joining Related Records .......................................................5-15
Review Questions ..................................................................................5-20

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-1


Module 5: Joining Records Basic Query for Financials 9.0

Lesson 1:
Overview of Joins and Record Relationships
There may be times when you need to display data from multiple tables in
one query. This is accomplished using record joins. In order to join records
effectively, you must understand how the tables relate to each other.
In this lesson, you learn about the different record relationships in
PeopleSoft and how they are used to join records.

Joining Records
Query enables you to query against multiple tables using joins. Joins link
multiple records together so that you can use them in one query.
Records are joined on their common fields. Often, the common fields are
also the key fields. Every record in the system has key fields that uniquely
identify the data contained within the record. Key fields are identified with
a key icon in front of the field name on the Query page.
When you link tables using common fields, you ensure that you do not
retrieve duplicate data in your query results. For example, if you want to
join the VENDOR record to the VENDOR_ADDR record, you want the
system to look for the rows in each record where the SETID and
VENDOR_ID (the key fields) are the same.
Look at the two records below:

VENDOR Record
SETID VENDOR_ID NAME1 VENDOR_CLASS
HC 000001 Main Street Courier R
MFG 000001 Robert’s Packaging R
MFG 000002 Sandy’s Office Supplies R
MFG 000003 Harvey’s Cleaning Service R

VENDOR_ADDR Record
SETID VENDOR_ID ADDRESS1 PHONE
HC 000001 123 Oak Park Dr. 555-1212
MFG 000002 820 Lenox Rd. 555-4321

Running a query against these records without first joining them would
produce the following output:
SETID VENDOR NAME1 CLASS ADDRESS1 PHONE

5-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

HC 000001 Main Street Courier R 123 Oak Park Dr. 555-1212


HC 000001 Main Street Courier R 820 Lenox Rd. 555-4321
MFG 000001 Robert’s Packaging R 123 Oak Park Dr. 555-1212
MFG 000001 Robert’s Packaging R 820 Lenox Rd. 555-4321
MFG 000002 Jan’s Office Supplies R 123 Oak Park Dr. 555-1212
MFG 000002 Jan’s Office Supplies R 820 Lenox Rd. 555-4321
MFG 000003 ABC Cleaning Service R 123 Oak Park Dr. 555-1212
MFG 000003 ABC Cleaning Service R 820 Lenox Rd. 555-4321

When the system does not know how to link the two tables together, it
creates a row for every combination of the two records. Since the first
record has three rows and the second has two, you end up with six rows.
This is called a Cartesian join and is not what you want. Improperly joined
records can cause serious performance problems with large queries.
These records have two common fields: SETID and VENDOR_ID. These
fields are also key fields. If you joined the records using the common fields
and ran the query, you would have the following result with an equivalent
join:
SETID VENDOR NAME1 CLASS ADDRESS1 PHONE
HC 000001 Main Street Courier R 123 Oak Park Dr. 555-1212
MFG 000002 Jan’s Office Supplies R 820 Lenox Rd. 555-4321

Notice that there are only two rows of data in the output. When you join
records, only matching rows in both records are selected. Harvey’s
Cleaning Service had no data in the VENDOR_ADDR record. Therefore, it
was not included in the results. We discuss including rows that do not
have a match in the lesson on outer joins.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-3


Module 5: Joining Records Basic Query for Financials 9.0

The following chart is an application structure overview. It shows the


technical relationships between the tables of data based on their key
structure.

Bank Setid
Bank_CD
Bank_Acct_Key
Pymnt_ID
Pay_Cycle
Create_Dttm
Accounting_DT
Remit_Setid
Remit_Vendor
Pay_Cycle
Accounting_Dt

Vendor_Pay Vendor Vendor_Address

Setid Setid Setid


Vendor_ID Vendor_ID Vendor_ID
Effdt Address_Seq_Num
Effdt
Bank_CD Remit_Setid
Bank_Acct_Key Remit_Vendor

Voucher Voucher_Line Vchr_Acctg_Line

Business_Unit Business_Unit Business_Unit


Voucher_ID Voucher_ID Voucher_ID
Voucher_Line_Num Voucher_Line_Num
Appl_Jrnl_ID
Vendor_Setid Pymnt_Cnt
Vendor_ID Unpost_Seq
Distrib_Line_Num
Dst_Acct_Type

5-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

Record Relationships
Before you can query against multiple records, you must first identify their
relationship and join them accordingly. Records can have one of three
different types of relationships in PeopleSoft:

Type Description
Hierarchical One record is a parent or child of another. You can
identify records with this type of relationship by looking
at the query tree on the Record Selection page. The
VENDOR and VENDOR_ADDR records are examples
of records with a hierarchical relationship, where the
VENDOR record is the parent record and the
VENDOR_ADDR record is the child record.
Related record One record is a prompt table for a field in another
record. You can identify this type of relationship by
looking at the Query page. Any fields that have a table
name on the row with the field name have a related
prompt table. The DEPTID field in the VOUCHER
record is an example of a field with a related record. It
is related to the DEPARTMENT_TBL.
No established Two records with no established relationship. The
relationship VENDOR and VOUCHER records are examples of
records with no established relationship.

Once you have identified the relationship between two records, you can
use the appropriate join to bring them together in one query.
Remember that records are joined on their common fields. When you work
with records that have an established relationship, the system
automatically joins the records for you when you select an additional table
using the hierarchical or related record option on the Join menu.
When you are working with two records with no established relationship,
you must join key fields manually. This is done by selecting both records
on the Records page and building the join logic for the common fields on
the Criteria page.

When joining two unrelated records, it is important that you identify


and join on every field that is common to the two records. Otherwise, your
results are not accurate. We will not cover this type of join in this class.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-5


Module 5: Joining Records Basic Query for Financials 9.0

Outer Joins
The joins that you have learned about so far are called “equivalent joins.”
This means that rows of data are selected only when values for their
common fields appear in both tables. An outer join allows you to retrieve
data regardless of whether values occur in both.
Review the two tables below.
VENDOR VENDOR_TYPE
SetID Vendor_ID Name1 SetID Vendor_ID Vendor_Type
HC 00001 Elmo’s Advertising HC 00001 Advertising
MFG 00005 Discount Airlines MFG 00005 Transportation
MFG 00028 Office Depot

If you joined the above two tables using a standard any join, you would
receive the following output:

Set_ID Vendor_ID Name1 Vendor_Type


HC 00001 Elmo’s Advertising Advertising
MFG 00005 Discount Airlines Transportation

Notice that only Elmo’s Advertising and Discount Airlines appear in the
results. The reason for this is that they have an entry in both tables. Office
Depot has not been assigned a vendor type. Therefore, it was omitted
from the results.
If you joined the two records using an outer join, you would get the
following results:

Set_ID Vendor_ID Name1 Vendor_Type


HC 00001 Elmo’s Advertising Advertising
MFG 00005 Discount Airlines Transportation
MFG 00028 Office Depot

Notice that Office Depot now appears in the results. The outer join tells the
system you want to see every row in each table, regardless of whether
they appear in both.

Most RDMS support outer joins and the syntax for outer joins is
RDMS-specific. Query does not support the outer join syntax for DB2,
Informix, and Microsoft SQL Server. We will not cover this type of join in
this class.

5-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

Lesson 2:
Joining Hierarchical Records
A hierarchical join is a join between a parent table and a child table. A
child table has all the same key fields as the parent plus one or more
additional fields. Therefore, these tables have an established relationship.
When you are working with two records that have an established
relationship, the process of joining them is very simple. Once you select
the tables, the system identifies the key fields and automatically links them
for you. At that point, you have access to all the fields from all the records.
VENDOR and VENDOR_ADDR are examples of parent and child tables.
The key fields for the VENDOR table are:
• SETID
• VENDOR_ID
The key fields for the VENDOR-ADDR table are:
• SETID
• VENDOR_ID
• ADDRESS_SEQ_NUM
• EFFDT
These tables have two common fields that the system joins on
automatically.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-7


Module 5: Joining Records Basic Query for Financials 9.0

Practice – Joining Hierarchical Records


Previously, we created a query of vendor addresses from the
VENDOR_ADDR records. The query did not contain the vendor name
because that field is not stored on the Vendor Address table—it is stored
on the Vendor Header table. Now we will create a query that joins the
records from both tables so we can see the vendor name in addition to the
address. We will add criteria to select only approved vendors in the state
of Georgia.

To select and join records with a hierarchical relationship:


1. Click Query Manager.
Peoplesoft Home Â
Reporting Tools  Query  The Query Manager – Find an Existing Query page appears.
Query Manager

2. Click Create New Query.


The Records page appears.

3. Enter the following in the Search by fields:


• Leave Record Name in the first field
• Type VENDOR in the second field

5-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

4. Click .
A list of records meeting the search criteria appears.

5. Click Add Record beside VENDOR – Vendor Header Table.


The Query tab is automatically selected.

6. Click Hierarchy Join.


A list of records available for a hierarchical join appears.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-9


Module 5: Joining Records Basic Query for Financials 9.0

7. Click VENDOR_ADDR-Vendor Address.


An effective date message appears.

8. Click .
The Query page reappears with the selected record listed with
In this screen shot, the
B as the Alias.
A record is collapsed or closed, so
you cannot see its fields. The B
record is open or expanded, so
you can see its fields.

To select the fields and save the query:


9. Click beside the A record to expand it.
The fields in the A record appear.
Two tables can have a 10. Select the following VENDOR fields:
field with the same name that
contains different data. NAME1 in • SETID
the VENDOR table contains the
• VENDOR_ID
name of the vendor. NAME1 in
the VENDOR_ADDR table • NAME1
contains a contact name.
• VENDOR_STATUS
11. Click to collapse the A record.

5-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

12. Select the following VENDOR-ADDR fields:


• NAME1
• ADDRESS1
• ADDRESS2
• CITY
• STATE
• POSTAL
13. Click .
The save page appears.
14. Type XXX_TRAINING_QUERY_JOIN1 in the Query field.
XXX=your initials 15. Type Vendor address join in the Description field.
16. Type QUERY_TRAINING in the Folder field.
17. Select Private in the Owner field.

18. Click .
The new query is saved.
19. Click on the Fields tab.
The Fields page appears.

Notice that the fields coming from the VENDOR table


have an A in front of them, and the fields coming from the
VENDOR_ADDR table have a B in front of them.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-11


Module 5: Joining Records Basic Query for Financials 9.0

Now establish your search criteria for this query. Remember that we want
approved vendors in the state of Georgia.

To specify criteria against the vendor status field:

20. Click on the VENDOR_STATUS row.


The Edit Criteria Properties page appears.

21. Leave the defaults in the Expression 1 Type and Expression 1


boxes.
22. Leave equal to in the Condition Type field.
23. Leave Constant in the Expression 2 Type box.
24. Click beside the Constant field.
The Select A Constant page appears.

25. Click Select Constant on the Approved row.


The Edit Criteria Properties page reappears and the value
selected appears in the Constant field.

26. Click .
The Fields page reappears.
27. Click .
The changes to the query are saved.

5-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

To specify criteria against the state field:

28. Click on the STATE row.


The Edit Criteria Properties page appears.
29. Leave the defaults in the Expression 1 Type and Expression 1
boxes.
30. Leave equal to in the Condition Type field.
31. Leave Constant in the Expression 2 Type box.
32. Type GA in the Constant field.

33. Click .
The Fields page reappears.
34. Click on the Criteria tab.
The new criteria row appears.

The query is complete. Now save it and run it.

To save the query and run it:


35. Click .
The changes to the query are saved.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-13


Module 5: Joining Records Basic Query for Financials 9.0

36. Click on the Run tab.


After a few moments of processing, the Run page appears with
the results of the query.

5-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

Lesson 3:
Joining Related Records
If a field in a table has a prompt table associated with it, then those two
tables have a related record relationship. Having a prompt table
associated with a field means you can pick a value from a list and the
entry is validated.
Joining related records is similar to joining hierarchical records because
the system identifies the key fields and automatically links them for you. In
a hierarchical join, the tables are joined on the common key fields. In a
related record join, the common fields may not be key fields.

Practice – Joining Records with a Related


Record Relationship
Let’s say that you want the entire set ID name to appear in the query
results instead of the abbreviation. Since the table you are using only
contains the abbreviation, you need to join this table with the prompt table
that contains the full description.

Join the related record for SETID and add the description to the query.

To select and join a related record:


1. Click on the Query tab.
The Query page appears.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-15


Module 5: Joining Records Basic Query for Financials 9.0

2. Click Join SETID_TBL - TableSet ID’s.


3. When prompted to select a Join Type, select the Standard Join
Notice that option.
tables A and B are
collapsed automatically.

The selected record appears as the third item on the Query


page. It has C as the Alias and its fields are displayed.

4. Select the DESCR field under table C to add it to the query.


5. Click .
The changes to the query are saved.

Change the DESCR heading to identify it as the Set ID Name and position
it immediately after the set ID code.

To format the query:


6. Click on the Fields tab.
The Fields page appears.

7. Click on the row containing the DESCR field.


The Edit Field Properties page appears.
8. Select the Text radio button in the Heading box.
9. Type Set ID Name in the Heading Text field.

5-16 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

10. Click .
The new name appears in the Heading Text column.
11. Click .
The Edit Field Ordering page appears.
12. Type 2 in the New Column field for DESCR.
13. Click OK.
The column number changes and automatically adjusts the
subsequent columns.

The query is complete. Now save the changes and run the query.

To save the query and run it:


14. Click .
The changes to the query are saved.
15. Click on the Run tab.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-17


Module 5: Joining Records Basic Query for Financials 9.0

After a few moments of processing, the new query results are


displayed.

5-18 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Basic Query for Financials 9.0 Module 5: Joining Records

Exercise 5-1: Joining Records


In this exercise, you create a query that has a hierarchical join and a
related record join.

Instructions
You need a listing of all paid vouchers after 01/21/2009. The list should
identify the vendor ID and include any payment information.
Include the following fields:

Record Field
VOUCHER BUSINESS_UNIT
VENDOR_ID
PYMNT_VCHR_XREF (hierarchy join) PYMNT_ID
PAID_AMT
SCHEDULED_PAY_DT
PYMNT_HANDLING_CD
PYMNT_HNDL_TBL (related join) DESCR

Save the query as XXX_TRAINING_QUERY_ JOINS and enter an


XXX=your initials appropriate description.
Select vouchers with a PAID_AMT > 0.
The results should be sorted by scheduled payment date from the most
recent to the oldest.

Hints
9 Select the fields from the first record before clicking Hierarchy Join.

02/20/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 5-19


Module 5: Joining Records Basic Query for Financials 9.0

Review Questions

1. When is it necessary to join records to build a query?

2. What are the three types of joins?

3. What type of relationship do records have that are joined through a Record Hierarchy
join?

4. What determines if two records can be joined via the Related Record join?

5-20 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/20/09


Appendix A
Financial Tables
Following is a brief description of some of the more commonly used tables
in the PeopleSoft financial and Supply-Chain applications.

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-1


Appendix C: Financials Tables Basic Query for Financials 9.0

General Ledger Tables


Record Name Record Description
JRNL_HEADER This table contains journal header information, such as
the journal ID, journal date and journal totals.
JRNL_LN This table contains journal line information, including the
ChartField value breakdown of a journal entry.
LEDGER This table contains high-level journal information after it
has been summarized and posted to the ledger.

A-2 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

Accounts Payable Tables


Record Name Record Description
VENDOR This table contains default information about
vendors.
VENDOR_ADDRESS This table contains effective-dated vendor address
data.
VENDOR_INVOICE This table contains data about invoices received
from vendors and is effective-dated.
VENDOR_PAY This table contains data about vendor payment
terms and default options. It is an effective-dated
table.
VOUCHER This table contains information about vouchers,
including invoice, vendor, and voucher approval
data.
VOUCHER_LINE This table contains detailed by-line information about
vouchers, including dollar amounts.
VCHR_ACCTG_LINE This table contains information about vouchers,
including accounting and journal dates.
VCHR_HST This table contains historical data about vouchers.
PYMNT_VCHR_XREF This table contains data about payments made on
vouchers.
PAYMENT_TBL This table contains default information about
payments to be made, including bank account and
pay cycle data.
PYCYCL This table contains data about pay-cycles, including
payment dates.
PYMNT_TBL_HST This table contains historical payment data.

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-3


Appendix C: Financials Tables Basic Query for Financials 9.0

Project Costing Tables


Record Name Record Description
PROJECT This table contains basic information on projects
PROJ_RESOURCE This table contains all of the collected costs for
project.
PAYMENT This table contains default information about
payments to be made, including bank account and
pay cycle data.

A-4 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-5


Appendix C: Financials Tables Basic Query for Financials 9.0

Asset Management Tables


Record Name Record Description
ASSET Table that contains the information related to assets
BOOK The table that contains the book information that is
tied to an asset
COST The table that contains the information related to the
cost of the assets in the system
DEPRECIATION The table that contains the information related to the
depreciation of the assets in the system
INFL_ADJ The table that contains the information related to the
depreciation of the assets in the system.

A-6 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-7


Appendix C: Financials Tables Basic Query for Financials 9.0

Withholding Tables
Record Name Record Description
DC_WH_CERT_CNT Contains counter numbers for withholding certificates
R
DC_WH_CODE Contains Withholding codes, percentages and
account numbers
DC_WH_ENTITY Contains Withholding Entity information
DC_WTHD_ADJUST Adjustments made to withholding after posting
process is run
DC_WTHD_DETAIL Withholding table with details for each vouchers
DC_WTHD_HDR VAT and PUC information for each voucher
DC_WTHD_RPT_TB Cosolidated reporting table that contains one row of
L data per vouchers with all withholding entries

A-8 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-9


Appendix C: Financials Tables Basic Query for Financials 9.0

Purchasing Tables
Record Name Record Description
PO_HDR Contains the business unit, po id, date, buyer and
other header type information
PO_LINE Contains the item id and item related information
PO_LINE_SHIP Contains the quantity and price information related to
the lines. This table should be joined with PO_LINE
to retrieve relevant information to the line items.
PO_LINE_DISTRIB Contains the chartfield distribution information related
to the PO_LINE and PO_LINE_SHIP records

A-10 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-11


Appendix C: Financials Tables Basic Query for Financials 9.0

Requisition Tables
Record Name Record Description
REQ_HDR Table contains the business unit, req id, date,
requestor and other header information
REQ_LINE Contains the item id and item related information
REQ_LINE_SHIP Contains the quantity and pricing information
REQ_LINE_DISTRIB Contains the chartfield distribution information for the
lines in REQ_LINE_SHIP

A-12 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

Receiving Tables
Record Name Record Description
RECV_HDR Contains the header information for a receipt
RECV_LN_SHIP Contains the item id, items related information, etc.
RECV_LN_DISTRIB Contains the distribution information related to the
lines.

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-13


Appendix C: Financials Tables Basic Query for Financials 9.0

A-14 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. 02/24/09


Basic Query for Financials 9.0 Appendix C: Financials Tables

Item Tables
Record Name Record Description
MASTER_ITEM_TBL Contains the item id,description and other information
BU_ITEMS_INV Contains the quantity information for each items
defined for a business unit
INV_ITEMS Contains more descriptive item information
ITEM_MFG Contains the manufacturer and manufacturer item id
information
PURCH_ITEM_ATTR Contains the purchasing related information for items
ITM_VENDOR Contains the priority vendor information
ITM_VENDOR_LOC Contains the vendor location information
ITM_VENDOR_MFG Contains the priority vendor manufacturer information
ITM_VNDR_UOM Contains the priority vendor unit of measure
information
ITM_VNDR_UOM_P Contains the priority vendor price information
R

02/24/09 Proprietary and Confidential to Cedar Enterprise Solutions, Inc. A-15

You might also like