Download - SpearMC PeopleSoft v9 Query Manager Training
PeopleSoft Query Manager End User Training Guide
Contact Information:
SpearMC Consulting
1‐866‐SPEARMC www.spearmc.com
SpearMC – Query Manager Training Guide
CHAPTER 1‐GETTING STARTED .................................................................................................................. 1
OVERVIEW OF QUERY MANAGER ................................................................................................................. 1
COURSE OBJECTIVES ..................................................................................................................................... 1
ACCESSING PEOPLESOFT QUERY ................................................................................................................... 1
CHAPTER 2‐ACCESSING QUERY MANAGER ................................................................................................ 3
EXPLORING QUERY MANAGER PAGES .......................................................................................................... 3
QUERY MANAGER COMMON ACTIONS ...................................................................................................... 27
CHAPTER 3‐WORKING WITH EXISTING QUERIES...................................................................................... 33
SEARCHING FOR EXISTING QUERIES ........................................................................................................... 33
MANAGING QUERIES .................................................................................................................................. 39
CHAPTER 4 ‐WORKING WITH RECORDS ................................................................................................... 47
SEARCHING FOR RECORDS .......................................................................................................................... 47
PREVIEWING FIELDS .................................................................................................................................... 50
ADDING RECORDS ....................................................................................................................................... 52
DELETING RECORDS .................................................................................................................................... 52
CHAPTER 5 ‐WORKING WITH FIELDS ....................................................................................................... 53
ADDING FIELDS ............................................................................................................................................ 53
CHANGING COLUMN DISPLAY ORDER ........................................................................................................ 54
DEFINING SORT ORDER ............................................................................................................................... 57
CHANGING COLUMN HEADINGS ................................................................................................................. 60
APPLYING AGGREGATE FUNCTIONS ........................................................................................................... 62
DELETING FIELDS ......................................................................................................................................... 66
CHAPTER 6 ‐WORKING WITH CRITERIA ................................................................................................... 67
SpearMC – Query Manager Training Guide
DEFINING CRITERIA ..................................................................................................................................... 67
WORKING WITH MULTIPLE CRITERIA .......................................................................................................... 75
DEFINING DISTINCT CRITERIA ..................................................................................................................... 82
EDITING CRITERIA ........................................................................................................................................ 83
DELETING CRITERIA ..................................................................................................................................... 84
CHAPTER 7‐BUILDING PROMPTS ............................................................................................................. 85
CREATING PROMPTS ................................................................................................................................... 85
ADDING PROMPTS TO CRITERIA ................................................................................................................. 87
DELETING PROMPTS .................................................................................................................................... 88
CHAPTER 8 ‐BUILDING EXPRESSIONS ...................................................................................................... 89
DEFINING EXPRESSIONS .............................................................................................................................. 89
DEFINING AGGREGATE FUNCTIONS ............................................................................................................ 97
ADDING EXPRESSIONS TO CRITERIA .......................................................................................................... 101
DELETING EXPRESSIONS ............................................................................................................................ 101
CHAPTER 9 – BUILDING SUBQUERIES .................................................................................................... 103
DEFINING A SUBQUERY ............................................................................................................................. 103
CHAPTER 10‐BUILDING LIST OF VALUES ................................................................................................ 109
DEFINING LIST OF VALUES ......................................................................................................................... 109
DELETING LIST OF VALUES ........................................................................................................................ 113
CHAPTER 11 ‐UNDERSTANDING JOINS .................................................................................................. 115
CREATING HIERARCHY JOINS .................................................................................................................... 115
DELETING HIERARCHY JOINS ..................................................................................................................... 117
CREATING RELATED RECORD JOINS .......................................................................................................... 117
DELETING RELATED RECORD JOINS ........................................................................................................... 121
SpearMC – Query Manager Training Guide
CREATING ANY RECORD JOINS .................................................................................................................. 121
CHAPTER 12 ‐SAVING QUERIES ............................................................................................................. 129
SAVING A NEW QUERY .............................................................................................................................. 130
SAVING CHANGES ...................................................................................................................................... 130
SAVING A COPY ......................................................................................................................................... 130
CHAPTER 13 ‐RUNNING QUERIES .......................................................................................................... 131
USING PROMPTS ....................................................................................................................................... 131
RUNNING TO HTML ................................................................................................................................... 132
RUNNING TO EXCEL ................................................................................................................................... 139
PREVIEWING .............................................................................................................................................. 143
CHAPTER 14– FINANCIALS DESKTOP REFERENCE ................................................................................... 147
DEFINING EXCEL FILE TYPES ...................................................................................................................... 147
PLANNING GUIDE FOR BUILDING QUERIES ............................................................................................... 149
APPENDIX – TABLES USED FOR REPORTING .......................................................................................... 151
SpearMC – Query Manager Training Guide Page 1
CHAPTER 1GETTING STARTED OVERVIEW OF QUERY MANAGER
Welcome to PeopleSoft Query Manager Basics! This manual contains the tools needed to learn the concepts and procedures involved in creating and running queries in PeopleSoft Query Manager. Users will learn the basic functions of Query Manager including, searching for predefined queries, creating new queries, managing queries, running queries, and exporting query results.
COURSE OBJECTIVES
By the end of this course, users should have the tools and information necessary to:
Access Query Manager Navigate Query Manager Find Existing Queries Manage Queries Create and Modify Queries Run Queries
ACCESSING PEOPLESOFT QUERY
PeopleSoft databases are accessed through an internet web browser. The following URLs currently provide access to the Financial Applications. Enter the URL in the Address field of the web browser. Contact a supervisor for updated addresses for production, reporting, quality assurance, and user training purposes.
** SPECIFIC TO CLIENT SYSTEM**
Add PeopleSoft database URLs to the web browser’s Favorites Folder for easy access to PeopleSoft databases.
Query options display based on user roles and security. To access PeopleSoft Query functions, expand or double‐click Reporting Tools in the Navigation Menu. The Query folder contains links to Query Manager, Query Viewer, and Query Scheduler.
Query Manager: Allows users to create new queries, modify existing queries, and schedule queries to run at a later date.
Query Viewer: Provides ‘read‐only’ access to predefined queries. Users can search, run, print, and download query data.
Query Scheduler: Allows users to manage queries scheduled to run at a later date.
Page 2 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 3
CHAPTER 2ACCESSING QUERY MANAGER
To open Query Manager, navigate to Reporting Tools and access Query. Access to Query Manager and its functions is based on user security. Some options may not be available to all users.
Collapse the Navigation Menu while working in a module to view the entire PeopleSoft page. Expand the Navigation Menu to navigate to a different module.
Query Manager opens in query search mode. From the main Query Manager Page, users search for an existing query using Basic or Advanced Search, and create new queries
EXPLORING QUERY MANAGER PAGES
Query Manager is organized as a group of pages. The pages open when accessing an existing query, and when building a new query. Each page serves a function when creating, modifying, or reviewing queries.
Page 4 SpearMC – Query Manager Training Guide
Records Page
The Records Page provides Basic and Advanced Searches to find records in the PeopleSoft database. The Records Page provides search, preview, and join functionality.
Access the Records Page to:
Search for Records Preview Fields Add/Join Records
Records Search Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Search By: The Basic Search and Advanced Search provide the following categories to guide a record search:
SpearMC – Query Manager Training Guide Page 5
Access Group Name: Provides a list of records based on security access to table information. Contains Field Name: Provides a list of records containing a specific field. Description: Provides a list of records with a keyword contained in the records descriptive name. Record Name: Provides a list of records based on the record’s database name.
Basic Search: The Basic Search assumes that the criteria entered will be found at the beginning of the information requested. Leaving the criteria field blank returns all records. Use wildcards to expand the search beyond the ‘Begins with’ condition.
A Note on Wildcards – Use wildcards as placeholders for data when conducting a search. The most commonly used wildcard in PeopleSoft is the % symbol.
%value: Searches for data containing the word ‘value’ at the end of a data string.
%value%: Searches for data containing the word ‘value’ within a data string.
value%: Searches for data containing the word ‘value’ at the beginning of a data string.
Advanced Search: Opens a search page allowing the use of conditional operators to expand the flexibility of searching for records. Advanced Search uses the same fields for the Search By options as the Basic Search. Access Conditional Operators from the drop‐down list.
Page 6 SpearMC – Query Manager Training Guide
< Results are less than the criteria entered. <= Results are less than or equal to the criteria entered. = Results are exactly equal to the criteria entered. > Results are greater than the criteria entered. >= Results are greater than or equal to the criteria entered. Begins with Results begin with the criteria entered. Between Results fall within and include the range entered. Separate range with commas. Contains Results contain some form of the criteria entered. Entering beg would return
Beginning, Beg., etc. In Results presented have one or more of the criteria entered. Separate criteria with
commas. Entering Ledger and Bank would produce results containing either ledger or bank.
Not = Results do not include the criteria entered. Entering Ledger will prevent Ledger from returning.
Records Results Information
Records meeting the criteria entered returns in a list. From the results, add records to the query, or preview the fields contained within the record.
SpearMC – Query Manager Training Guide Page 7
Recname: Displays the name and description of the record retrieved by the search.
Add Record/Join Record: Adds the record to the query. Add Record opens the Query Page to add fields to the query. After the first record is added, Add Record changes to Join Record. Each time a new record is needed, navigate to the Records tab to search and join a record.
Show Fields: Previews the fields contained in the record. Previewing the fields helps determine if the record will meet the needs of the query.
Page 8 SpearMC – Query Manager Training Guide
Key: A key field is a unique identifier in a record. There can be a single or multiple key fields for each record. A key field displays ‘Y’ in the column next to the field name. Using all key fields prevents the retrieval of duplicate rows of data. For example, omitting the Effective Date key field from a query retrieves multiple rows of like data, each with a different Effective Date.
Description: Displays the field name and the description of the data field.
SpearMC – Query Manager Training Guide Page 9
Query Page
The Query Page displays records selected for the query and fields contained within the records. A folder with an alias name represents each record. The record folders expand to display fields. A field used for the query has a checkmark next to its name. Navigate between the Records Page and Query Page to add additional records and fields.
Access the Query Page to:
Add Fields Create Record Joins Create Hierarchy Joins Add Criteria Delete Records
Page 10 SpearMC – Query Manager Training Guide
Query Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Record Name and Description: The name of each record added to the query displays with a folder icon. Expand and collapse the folder to view and hide the fields contained in each record.
The alpha character before the record name represents an alias name. The system assigns an alias name to distinguish fields having the same name in multiple records.
Field Name and Description: The name and description of fields contained in a record display when a record folder is expanded.
Key Field: Indicates the field is a unique identifier for each record.
Sort Fields: Sorts the field display in alphabetical order. To remove the sort, click the icon again.
Hierarchy Join: Joins a parent and child record. A Hierarchy Join link displays for each record in the query.
Delete Record: Removes a record from the query.
Select Fields: Adds and removes fields from the query. Check All Fields selects all fields for the query. Uncheck All Fields removes the field selections.
Related Records Join: Joins related records with common fields. If a field has a relationship with another record, a join link displays next to the field.
Expand All Records/Collapse All Records: Expands and collapses folders for multiple records.
Add Criteria: Opens the Criteria Page to add filter conditions to the field.
SpearMC – Query Manager Training Guide Page 11
Expressions Page
The Expressions Page is used to create calculations using Structured Query Language (SQL). Expression results can be displayed as a column in the query, or used as part of the query criteria.
Access the Expressions Page to:
Build Expressions Add Expressions to a Query Add Expressions to Criteria Edit Expressions Delete Expressions
Expressions Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Add Expression: Opens the Edit Expression Properties Page for expression definition.
Expression Text: Displays the logic defined in the Edit Expression Properties Page.
Use as Field: Adds the results of the expression to the query results.
Add Criteria: Opens the Edit Criteria Properties Page to create a criteria statement based on the expression results.
Edit: Opens the Edit Expression Properties Page to modify an existing expression.
Delete: Removes an expression from the query.
Page 12 SpearMC – Query Manager Training Guide
Edit Expression Properties
Expression Type: Create expressions using character, number, and date fields.
Length: The digit/character length for the expression results.
Decimals: The number of digits to display after the decimal in a numeric expression.
Aggregate Function: Defines the expression as a calculation using a SQL function.
Add Field: Adds a field to the expression.
Add Prompt: Adds a prompt to the expression if the calculation relies on information entered by a user.
SpearMC – Query Manager Training Guide Page 13
Prompts Page
Prompts allow users to enter data to filter a query. Creating prompts expands the use of a query beyond the needs of a single user. For example, adding prompts for Business Unit and Date Range expands the use of a general ledger query for use by all business units.
Access the Prompts Page to:
Define Prompts Edit Prompts Delete Prompts
Prompts Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Add Prompt: Opens the Edit Prompt Properties Page to define a new prompt.
Prompt: Displays the names of saved prompts.
Edit: Opens the Edit Prompt Properties Page to modify an existing prompt.
Delete: Removes the prompt from the query.
Page 14 SpearMC – Query Manager Training Guide
Edit Prompt Properties
Field Name: Defines the field used for the prompt comparison.
Type: Defines the data format of the field selected. Formats include character, number, and date. The information for this field auto populates based on the database definition for the field.
Format: Defines the data format for the field and prompt. This field auto populates based on the database definition for the field.
Length: Defines the length of the character or number for the field and prompt. This field auto populates based on the database definition for the field.
Decimals: Defines the decimal placement for a number field and prompt. This field auto populates based on the database definition for the field.
Edit Type: Defines the type of field edit for the prompt. This field auto populates based on the edit type defined for the field on the database.
Heading Type: Defines the text displayed when the prompt is presented to the user.
Heading Text: Defines label for the prompt when Heading Type of Text is selected.
Unique Prompt Name: The system assigned unique identifier for the prompt.
Prompt Table: Defines the database table to be used when comparing data entered by the user with the field.
SpearMC – Query Manager Training Guide Page 15
Fields Page
The Fields Page provides information regarding the individual fields selected to display in the query results.
Access the Fields Page to:
Define Criteria Define Expressions Edit Column Headings Define Sort Order Define Column Display Order Delete Fields from the Query
Fields Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Column: Designates the display order of the fields in the query results.
Record.Fieldname: Displays the record and field name.
Format: Displays the database format definition for the field.
Ord: Displays the sort order for the field. If descending sort order is defined, ‘D’ will also display in this column.
Page 16 SpearMC – Query Manager Training Guide
XLAT: Displays the value to appear in the query results when a Translate Table is used. .
“N” indicates no value will display in the query results. “S” indicates the code, or short value, will display in the query results. “L” indicates the code description, or long value, will display in query results.
Agg: Displays the Aggregate Function defined for a field.
Heading Text: Displays the column heading used in query results.
Add Criteria: Defines filter criteria using the field. If the field has an expression defined, the Edit Having Criteria Properties Page will display. If the field does not have an expression defined, the Edit Criteria Properties Page will display.
Edit: Opens the Edit Field Properties Page to define aggregate functions, column display order, column headings, and sort order for the field.
Delete: Removes the field from displaying in query results.
Reorder/Resort: Opens the Edit Field Ordering Page to change the column display and data sort order.
Edit Field Properties
Field Name: Displays the alias name of the field being modified.
Column: Defines which column the data appears in the query results.
Order By Number: Defines the sort order for the field.
Descending: Defines ascending/descending sort order for the field.
SpearMC – Query Manager Training Guide Page 17
Heading: Defines the column heading to display in query results.
Heading Text: Defines the column heading to display if the Text option is selected.
Unique Field Name: Displays the alias name of the field.
Aggregate: Defines the field to return a single value for multiple rows of data.
Edit Field Ordering Page
New Column: Entry field for assigning a new column display position for the field.
Column: The current column display position for the field.
Record.Fieldname: The record and field name for the data.
Order By: The current sort order for the field.
Descending: Indicates if the data is sorted in descending or ascending order.
New Order By: Entry field for assigning a new sort order for the field.
Page 18 SpearMC – Query Manager Training Guide
Criteria Page
A query without criteria retrieves every row of data in the record. Criteria statements filter the data to narrow results. Criteria statements filter data by comparing field values, expressions, and logical operators.
Access the Criteria Page to:
Define Criteria Edit Criteria Group Criteria Reorder Criteria Delete Criteria
Criteria Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Add Criteria: Opens the Edit Criteria Properties Page to define criteria.
Group Criteria: Opens the Edit Criteria Grouping Page to apply grouping logic to the criteria when multiple operators of different types are used.
Reorder Criteria: Opens the Edit Criteria Ordering Page to change the order criteria is applied to the query.
Logical: Displays the operator applied to connect the criteria statements. A drop‐down list provides available options.
SpearMC – Query Manager Training Guide Page 19
Expression 1: Displays the field or expression defined as the filter data.
Condition Type: Displays the comparison operator defined for the filter.
Expression 2: Displays the field or expression defined as the comparison data for the filter.
Edit: Opens the Edit Criteria Properties Page to define criteria.
Delete: Removes the criteria from the query.
Edit Criteria Properties
Expression 1: Defines the data to be filtered. If the filter is based on a field, the field containing the data will be defined. If the filter is based on an expression, the expression will be defined.
Condition Type: Defines the comparison logic for the two expressions. The Condition Type determines the definition of Expression 2. If Expression 1 is an Effective Date, special condition types become available.
Expression 2: Defines the comparison data or value. Data from Expression 1 compares to the data in Expression 2. The query retrieves data meeting the condition.
Page 20 SpearMC – Query Manager Training Guide
Edit Criteria Grouping Page
Logical: The logic operator connecting the criteria statements.
Grouping Field 1: The entry field for parenthesis to group criteria statements.
Expression 1: The logic defined for the filtering expression.
Condition Type: The logic defined for the expression operator.
Expression 2: The logic defined for the comparison data.
Grouping Field 2: The entry field for parenthesis to group criteria statements.
SpearMC – Query Manager Training Guide Page 21
Edit Criteria Ordering Page
New Position: The entry field for changing the order the query applies the criteria statement.
Position: The current order the query applies the criteria statement.
Expression 1: The logic defined for the filtering expression.
Condition Type: The logic defined for the comparison operator.
Expression 2: The logic defined for the comparison data.
Page 22 SpearMC – Query Manager Training Guide
Having Page
Add expression results to criteria statements using the Having Page. The Criteria Page only allows fields contained within a record to be added to criteria statements. For example, creating a query to provide a list of journal entries, where the sum of the journal entries for a date range is greater than zero, requires Having Criteria. An expression defines the sum of the journal entries. The result of the journal entry expression is added to a criteria statement to retrieve only those amounts having a total amount greater than zero. The query performs the calculation before applying the criteria statement.
Access the Having Page to:
Add Expression Results to Criteria Edit Having Criteria Group Having Criteria Reorder Having Criteria Delete Having Criteria
Having Page Information
Query Name and Description: The name and description for an existing query displays at the top of the page. When creating a new query, ‘New Unsaved Query’ displays for the Query Name, and a Description will not display.
Add Having Criteria: Opens the Edit Having Criteria Page to define criteria using an expression result.
Group Criteria: Opens the Edit Criteria Grouping Page to apply grouping logic to the criteria when multiple operators of different types are used.
Reorder Criteria: Opens the Edit Criteria Ordering Page to change the order the query applies criteria statements.
SpearMC – Query Manager Training Guide Page 23
Logical: Displays the operator connecting the criteria statements.
Expression 1: Displays the field or expression defined as the filter data.
Condition Type: Displays the comparison operator defined for the filter.
Expression 2: Displays the field or expression defined as the comparison data for the filter.
Edit: Opens the Edit Having Criteria Properties Page to define criteria.
Delete: Removes criteria statements from the query.
Edit Having Criteria Properties
Expression 1: Defines the data to be filtered. If the filter is based on a field, the field containing the data will be defined. If the filter is based on an expression, the expression will be defined.
Condition Type: Defines the comparison logic for the two expressions. The condition type selected determines how Expression 2 is defined. If Expression 1 is an Effective Date, special condition types become available.
Expression 2: Defines the comparison data or value. Data from Expression 1 is compared to the data in Expression 2. Data meeting the condition will be retrieved by the query.
Page 24 SpearMC – Query Manager Training Guide
Edit Criteria Grouping Page
Logical: The logic operator connecting the criteria statements.
Grouping Field 1: The entry field for parenthesis to group criteria statements.
Expression 1: The logic defined for the filtering expression.
Condition Type: The logic defined for the expression operator.
Expression 2: The logic defined for the comparison data.
Grouping Field 2: The entry field for parenthesis to group criteria statements.
SpearMC – Query Manager Training Guide Page 25
View SQL Page
The View SQL Page displays the definition of the query in Structured Query Language. Query Manager takes all fields, expressions, calculations, and criteria for the query and compiles it into SQL. Viewing SQL helps identify logic and data issues with queries. In addition, use the SQL of a working query with other query tools that may offer more flexibility in designing queries.
Page 26 SpearMC – Query Manager Training Guide
Preview Page
Use the Run Page to review query results prior to saving, printing, or downloading the query. From Run, navigate query results, refresh data after adding new information, and download the results to Excel.
Run Page Information
Prompts Used: If prompts were used to execute the query, the name of the prompt and the data entered by the user displays above the query results.
View All: Select to view all query results without pagination.
Rerun Query: Select to refresh the query results.
Download to Excel: Select to open query results in Excel.
SpearMC – Query Manager Training Guide Page 27
QUERY MANAGER COMMON ACTIONS
Navigating Results
After performing a search in Query Manager, results consistently display with a header to navigate through the results.
View All: Displays the search results on one page. By default, Query Viewer only displays 30 results at a time. Select View All to display all the records retrieved without pagination. The link reverts to View 30 after the results are displayed.
Page Navigation: The Query header displays the number of records displayed and the number of records retrieved. Quickly navigate to the first and last results pages using the First and Last link. Navigate one page at a time using the arrow buttons.
Customizing Query Manager
Every search performed in Query Manager produces a results page with a header. Customize results display to suit the needs of the individual user. The customization attaches to the User ID and database instance. Future search results for the page display in the order requested. Customizing the results display for one page does not affect the results on another page.
Page 28 SpearMC – Query Manager Training Guide
Customize Search Results Display
Select Customize from the Navigation Header. Select the column title from the Column Order list. Use the up and down arrow buttons to move the column title.
Customize Search Results Sort
Select Customize from the Navigation Header. Select the column title from the Column Order list. Use the right arrow button to copy the column title to the Sort Order list. If multiple column titles are added to the Sort Order list, use the up and down arrow buttons to move the column title.
Remove Columns from Sort
Select Customize from the Navigation Header. Select the column title from the Sort Order list. Select the delete icon to remove the column title.
Sort in Descending Order
Select Customize from the Navigation Header. Select the column title from the Sort Order list. Select the delete icon to remove the column title.
SpearMC – Query Manager Training Guide Page 29
Query Manager Commands
The following commands display at the bottom of Query Manager Pages.
Save/Save As: Use Save or Save As to commit query changes. Save overwrites the existing query. Save As saves a copy of the query.
Query: Name the query using standard naming conventions.
Description: A short description of the query’s purpose.
Folder: The name of the folder where the query was saved.
Page 30 SpearMC – Query Manager Training Guide
Query Type: Defines the query’s intended use.
o Archive: Used by the Data Archive Manager process. o User: Used to retrieve data directly from the PeopleSoft database. o Role: Used to determine contacts and communications links when working with
PeopleSoft Business process. o Process: Runs periodically as a batch process.
Owner: Save queries as either Public or Private. Public queries can be executed, opened, modified, or deleted by anyone with proper security access. Private queries can only be executed, opened, modified, or deleted by the individual who created the query.
Query Definition: A description and purpose of the query.
New Query: Opens the Records Page to start building a new query.
Preferences: Defines the display of record and field descriptions, enables automatic record joins, and enables auto preview. Preferences are User ID specific. Changes made to preferences will apply to each query created by the user.
Name Style: Defines the display of record and field names throughout Query Manager Pages.
Enable Auto Join: Determines fields creating a record join when adding multiple records to a query.
Enable Auto Preview: Causes the query to automatically rerun when accessing the Preview Page.
Properties: Displays the properties for a saved query. Query Properties are specific to the query being created. The information will change with each query created
SpearMC – Query Manager Training Guide Page 31
Query: The name assigned to the query.
Description: A short description of the query’s purpose.
Folder: The name of the folder used to categorize the query.
Query Type: Defines the query’s intended use.
o Archive: Used by the Data Archive Manager process. o User: Used to retrieve data directly from the PeopleSoft database. o Role: Used to determine contacts and communications links when working with
PeopleSoft Business process. o Process: Runs periodically as a batch process.
Query Definition: A description and purpose of the query.
Last Updated Date/Time: Provides the query creation or last modification date.
Last Update User ID: Provides identification of the person who created or last modified the query.
New Union/Delete Union: Use to join separate queries. The Records Page is opened for users to begin creating an additional query.
Return to Search: Opens the main Query Manager Page.
Page 32 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 33
CHAPTER 3WORKING WITH EXISTING QUERIES
Use Query Manager to execute, modify, rename, copy, and delete existing queries. The actions available in Query Manager are dependent upon User Security. Not all the functionality described may be available to every user with Query Manager access.
SEARCHING FOR EXISTING QUERIES
Query Manager provides two methods for finding existing queries: Basic Search and Advanced Search. Basic Search provides a general search using the ‘Begins with’ comparison operator. Advanced Search offers more comparison criteria to make the results more specific. Query Manager opens in Basic Search mode.
SEARCH FOR A QUERY
Select Search Method: Advanced or Basic Select Search By Option If using Advanced Search, Select Conditional Operator. Enter Search Data
Selecting a Search Method
Basic Search: Assumes that the criteria entered will be found at the beginning of a data string.
Advanced Search: Select Advanced Search to open the search page. Use the Conditional Operators in the drop‐down list to define the search.
Using Conditional Operators: In Advanced Search, Conditional Operators compare the search option with the value entered.
Page 34 SpearMC – Query Manager Training Guide
< Results are less than the criteria entered. <= Results are less than or equal to the criteria entered. = Results are exactly equal to the criteria entered. > Results are greater than the criteria entered. >= Results are greater than or equal to the criteria entered. Begins with Results begin with the criteria entered. Between Results fall within and include the range entered. Separate range with commas. Contains Results contain some form of the criteria entered. Entering beg would return
Beginning, Beg., etc. In Results presented have one or more of the criteria entered. Separate criteria with
commas. Entering Ledger and Bank would produce results containing either ledger or bank.
Not = Results do not include the criteria entered. Entering Ledger will prevent Ledger from returning.
SpearMC – Query Manager Training Guide Page 35
Defining Search By Option
When searching for an existing query, both the Basic Search and Advanced Search provide the following categories to guide the search. The default search category is Query Name.
Access Group Name: Provides a list of queries based on user security access to the database information. Enter the beginning of the Access Group Name or use the Lookup Tool to view a list of available groups. The search retrieves queries available to the security group selected.
WHAT IS THE LOOKUP TOOL?
The Lookup Tool displays as a magnifying glass next to or in place of searchable fields. Use to open tables containing predefined data for the field being searched. For instance, when searching on a Business Unit field, select the Look Up Tool for predefined Business Unit codes.
Description: The common name used to describe the query. Enter the beginning of the description or use wildcards for a partial name. Using wildcards before and after the search criteria returns any query with the criteria in the description. For instance, %beg% will return queries containing ‘Beg’, ‘beg’, and ‘beginning’ in the description.
Folder Name: The folder where the query is stored. Enter the beginning of the folder name or use wildcards to search for queries in specific folders.
Owner: Queries are saved as either Public or Private. Public queries can be executed, opened, modified, or deleted by anyone with proper security access. Private queries can only be executed, opened, modified, or deleted by the individual who created the query.
Page 36 SpearMC – Query Manager Training Guide
Query Name: Search for a query based on the name assigned when it was saved. Enter the beginning of the query name or use wildcards for partial names.
Type: Search for a query based on its function. The options for query type are Archive, User, Role, and Process. End‐users will generally use the User query type.
Archive: Used by the Data Archive Manager process.
User: Used to retrieve data directly from the PeopleSoft database.
Role: Used to determine contacts and communications links when working with PeopleSoft Business process.
Process: Runs periodically as a batch process. For instance, a query could be developed to run a monthly report of outstanding balances on accounts.
Uses Field Name: Search for queries using a specific field of data. A specific field name or the beginning of the field name can be entered. To be most specific, enter the exact field name.
Uses Record Name: Search for queries using a specific record. A specific record name or beginning of the name can be entered. To be most specific, enter the exact record name.
Entering Search Criteria Leaving the search field blank returns all queries. Use wildcards to expand the search beyond the ‘Begins with’ condition.
A Note on Wildcards – wildcards are place holders for data when conducting a search. The most commonly used wildcard in PeopleSoft is the % symbol.
%value: searches for data containing the word ‘value’ at the end of a data string.
%value%: searches for data containing the word ‘value’ within a data string.
value%: searches for data containing the word ‘value’ at the beginning of a data string.
Exploring Query Search Results Queries meeting the criteria return in a list. From the query search results, queries can be executed or opened for modification.
SpearMC – Query Manager Training Guide Page 37
Select: Use the Select checkbox to perform the same action on multiple queries. Check All selects all queries displayed for the same action. Uncheck All removes the selections.
Query Name: The name of the query. Click the query name to open the query for modification.
Descr: A description of the query.
Owner: Queries are saved as either Public or Private. Public queries can be executed, opened, modified, or deleted by anyone with proper security access. Private queries can only be executed, opened, modified, or deleted by the individual who created the query.
Folder: The name of the folder storing the query. This displays only if the query was assigned to a folder when it was created.
Page 38 SpearMC – Query Manager Training Guide
Filtering Results
Folder View: Use Folder View to filter results for queries stored in a specific folder. Folders are created using the Query Manager and queries can be assigned to folders when they are saved. Storing queries in folders helps in organizing queries by category, work process, or department.
SpearMC – Query Manager Training Guide Page 39
MANAGING QUERIES
Query Manager allows users to perform various organizational functions with queries. Queries can be assigned to a user’s favorite folder, copied to other users, deleted, organized in folders, and renamed.
Add frequently used queries to My Favorite Queries. Copy private queries to other users Organize public and private queries in folders. Delete obsolete queries. Rename existing queries.
The management tools are available on the main Query Manager Page. Use the Action drop‐down menu and the selection checkboxes to perform management functions on queries.
Select Checkboxes: Use the Select checkbox to perform an action on specific queries. Check All selects all queries for the same action. Uncheck All removes the selections.
My Favorite Queries
Use the Add to Favorites action to save a frequently used query to a favorite folder. The query is added to My Favorite Queries list and is associated to a User ID and database. The list is available each time Query Manager is accessed. The list can be cleared or specific entries removed.
Page 40 SpearMC – Query Manager Training Guide
If a query is run regularly as part of a business process, add it to My Favorite Queries.
ADD TO MY FAVORITE QUERIES
Search for an existing query on the main Query Manager Page. Select the checkboxes for the queries to be added to My Favorite Queries. Select Add to Favorites from the Action drop‐down list.
Deleting from My Favorite Queries
Queries are deleted from My Favorite Queries by selecting the Remove icon for the query or by selecting the Clear Favorites List button. Removing a query from My Favorites does not delete it from the database.
SpearMC – Query Manager Training Guide Page 41
Copying Queries to Other Users
A Private query may be copied to another user. This function is only performed on a query that is defined as Private when it was created or modified. This is useful in sharing queries within a work unit without making the queries Public.
The user you are copying queries to should have access to all the record information in the query. If the user does not have proper access, the copied queries will not appear in their list of available Private queries.
COPY TO ANOTHER USER
Select the queries to be copied from the main Query Manager Page. Select Copy to User from the Action drop‐down list. Select Go. Enter the User ID of the user who needs access to the query.
Page 42 SpearMC – Query Manager Training Guide
Deleting Queries
Obsolete queries may be deleted. Before deleting a query, confirm that the query is no longer used by anyone using the PeopleSoft databases. Query usage can be determined by technical staff.
If a Private query has been copied to another user, deleting the query will not delete the copied instance. If deleting a Private query that is shared within a work unit, notify the members to ensure that an obsolete query is no longer being used.
DELETE A QUERY
Select the queries to be deleted from the main Query Manager Page. Select Delete Selected from the Action drop‐down list. Select Go. Select to confirm the deletion on the confirmation page.
SpearMC – Query Manager Training Guide Page 43
Organizing with Folders
Assigning queries to folders makes it easier for users to locate queries associated to a business process. Queries may be assigned to existing folders or to a new folder.
MOVE TO AN EXISTING FOLDER
Select the queries to be moved from the main Query Manager Page. Select Move to Folder from the Action drop‐down list. Select Go. Select a folder from the drop‐down list. Select OK.
CREATE A NEW FOLDER
Select the queries to be moved from the main Query Manager Page. Select Move to Folder from the Action drop‐down list. Select Go. Enter a new folder name in the entry field. Select OK.
Page 44 SpearMC – Query Manager Training Guide
REMOVE QUERY FROM A FOLDER Search for the query on the main Query Manager Page. Select the query name to open the query pages. Select the Properties link at the bottom of the page. Delete the name from the Folder field
SpearMC – Query Manager Training Guide Page 45
Page 46 SpearMC – Query Manager Training Guide
Renaming Queries
An existing query may be renamed to make its title and description easier to identify and understand. Use the standard naming conventions defined by your organization when assigning a query name.
When renaming a Public query, notify all users of the query of the name change to prevent confusion.
RENAME A QUERY
Select the queries to be renamed from the main Query Manager Page. Select Rename Selected from the Action drop‐down list. Select Go. Enter the new names for the queries. Select OK.
SpearMC – Query Manager Training Guide Page 47
CHAPTER 4 WORKING WITH RECORDS PeopleSoft data is stored in tables. PeopleSoft applies record addresses to tables as identifiers. When working with queries, a record refers to a row of data in a table. A field is a subset of the record, and is represented as a column on the table. Records provide a high‐level address for the data locations. Use the Records Page to add records to a query.
ADD RECORDS TO A QUERY
Search for a Record on the Records Page. Select Show Fields to review fields contained in the record. Select Add Record/Join Record
SEARCHING FOR RECORDS
Search for and add records using the Records Page. Records meeting the search criteria return in a list. From the records results, records can be added to the query and the fields contained within the record can be viewed.
Selecting a Search Method
Basic Search: Assumes that the criteria entered will be found at the beginning of a data string.
Advanced Search: Select Advanced Search to open the search page. Use the Conditional Operators in the drop‐down list to define the search.
Using Conditional Operators: In Advanced Search, Conditional Operators compare the search option with the value entered.
Page 48 SpearMC – Query Manager Training Guide
< Results are less than the criteria entered.
<= Results are less than or equal to the criteria entered.
= Results are exactly equal to the criteria entered.
> Results are greater than the criteria entered.
>= Results are greater than or equal to the criteria entered.
Begins with Results begin with the criteria entered.
Between Results fall within and include the range entered. Separate range with commas.
Contains Results contain some form of the criteria entered. Entering beg would return Beginning, Beg., etc.
In Results presented have one or more of the criteria entered. Separate criteria with commas. Entering Ledger and Bank would produce results containing either ledger or bank.
Not = Results do not include the criteria entered. Entering Ledger will prevent Ledger from returning.
SpearMC – Query Manager Training Guide Page 49
Defining Search By Option
When searching for records, both the Basic Search and Advanced Search provide the following categories to guide the search. The default search category is Record Name.
Access Group Name: Provides a list of records based on user security access to the database information. Enter the exact group name, enter a partial name using wildcards, or use the Lookup Tool to view a list of available groups. The search retrieves records available to the security group selected.
Contains Field Name: Provides a list of records containing a specific field. Enter the exact field name, or use wildcards to search for a partial name.
Description: Provides a list of records based on the common record description. The common name used to describe the record. Enter a partial name using wildcards.
Record Name: Provides a list of records based on the database record name. Enter the exact record name, or use wildcards to search for a partial name.
Entering Search Criteria
Leaving the search field blank returns all records in the database. Use wildcards to expand the search beyond the ‘Begins with’ condition.
Page 50 SpearMC – Query Manager Training Guide
A Note on Wildcards – wildcards are place holders for data when conducting a search. The most commonly used wildcard in PeopleSoft is the % symbol. %value: searches for data containing the word ‘value’ at the end of a data string. %value%: searches for data containing the word ‘value’ within a data string. value%: searches for data containing the word ‘value’ at the beginning of a data string.
Exploring Record Search Results
Records meeting the criteria return in a list. From the query search results, records can be opened to view fields and added to queries.
PREVIEWING FIELDS
Select Show Fields to display the fields contained in the record. Reviewing this information helps determine if the record will meet the needs of the query. Select Return to navigate back to record search results.
KEY FIELDS
A key field is a unique identifier of a record. A record may have multiple key fields. If a field is a key field, ‘Y’ will display in the column next to the field name.
SpearMC – Query Manager Training Guide Page 51
Page 52 SpearMC – Query Manager Training Guide
ADDING RECORDS
Select the first record for a query by clicking Add Record. Add Record opens the Query Page allowing the user to select the fields for the query. To add additional records to the query, navigate to the Records Page to search and add a new record using Join Record.
DELETING RECORDS
Deleting a record from a query also deletes all fields contained in the record and the criteria defined for the fields. Records are deleted using the Query Page. Select the delete icon to remove a record from a query.
SpearMC – Query Manager Training Guide Page 53
CHAPTER 5 WORKING WITH FIELDS After a record has been selected for a query, Query Manager opens the Query Page. Fields are added to a query through the Query Page. Specific information regarding
ADD FIELDS TO A QUERY
Display Fields on Query Page Select Checkbox next to field name
ADDING FIELDS
Expand the record’s folder on the Query Page to view fields. Select the fields to be used in the query by clicking the checkbox next to the field name. To use all fields in the record, select Check All Fields. The fields selected will also display on the Fields Page.
Page 54 SpearMC – Query Manager Training Guide
CHANGING COLUMN DISPLAY ORDER
Query Manager applies a default display order to fields appearing in query results. When a query is run, the results will display the fields of data as columns. The query will display the columns in the order listed on the Fields Page. Change the display order for columns using the Reorder / Sort button.
A system assigned row‐ordering column appears as the first column in the query preview results. This column cannot be removed or reordered through Query Manager.
SpearMC – Query Manager Training Guide Page 55
Using Reorder / Sort Button
Use the Reorder / Sort button to change the display order for an individual field.
CHANGE COLUMN DISPLAY ORDER
Access the Edit Field Ordering page using Reorder / Sort Add a number in New Column to change the display
When the change to the Column Display Order is complete, the fields listed on the Fields Page will reorder according to the changes made. The column display order for the field is listed under the Col heading on the Fields Page, and query results display in the order defined.
Page 56 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 57
DEFINING SORT ORDER
Query Manager does not define a sort order for fields selected for a query. When a query is run, the results will display in the order the data is retrieved from the database. Change the data sort order using Reorder / Sort button.
Multiple sort criteria may be defined. Entering ‘1’ defines the field as the primary sort criteria, ‘2’ defines secondary sort, etc.
To remove a field from the sort criteria, change the Order By Number to ‘0’.
Page 58 SpearMC – Query Manager Training Guide
Using Edit Field Ordering Page
Use the Edit Field Ordering Page to define the sort order for all fields in the query.
CHANGE SORT ORDER FROM FIELD ORDERING PAGE
Access the Edit Field Ordering Page using Reorder/Sort. Enter the sort number in New Order By to change the display order in query results.
To sort the field data in descending order, select Descending.
SpearMC – Query Manager Training Guide Page 59
When the change to the Column Display Order is complete, the fields listed on the Fields Page will reorder according to the changes made. The sort order for the data is listed under the Ord heading. If the data is sorted in descending order, “D” will appear with the ordering number.
Page 60 SpearMC – Query Manager Training Guide
CHANGING COLUMN HEADINGS
Query Manager applies column headings to query results using the RFT Short Name defined for the field at the record level. Change the column heading in the query results using the Edit Field Properties Page.
Changing column headings to RFT Short Name or RFT Long Name do not display immediately on the Edit Field Properties Pages. Navigate back to the Fields Page to view how the column heading will display.
Column headings can be formatted by selecting one of the following options:
No Heading: A heading will not display for the column in the query results.
RFT Short: The short description for the column as defined for the field.
RFT Long: The long description for the column as defined for the field.
Text: A user defined heading will display for the column. If selected, the user defined heading is entered in Heading Text.
CHANGE COLUMN HEADING
Access the Edit Field Properties Page using Edit. Select the heading format. If Text is selected, enter the name of the column in Heading Text
SpearMC – Query Manager Training Guide Page 61
Page 62 SpearMC – Query Manager Training Guide
APPLYING AGGREGATE FUNCTIONS Defining an Aggregate Function for a field returns a single calculated value for a field rather than returning individual rows of data for the field. Use Aggregate Functions when providing summary data. Aggregate Functions are applied to individual fields using the Edit Field Properties Page.
The following Aggregate Functions are applied to individual fields of data using the Edit Field Properties Page:
None: Select if an aggregate value is not needed. Sum: Provides the total for the field from all rows retrieved by the query. Count: Provides the number of rows retrieved by the query. Min: Provides the lowest value of all rows retrieved by the query. Max: Provides the highest value of all rows retrieved by the query. Average: Provides the sum of values divided by the number of rows retrieved by the query.
DEFINE AGGREGATE FUNCTION
Access the Edit Field Properties Page using Edit. Select the Aggregate Function to be applied.
SpearMC – Query Manager Training Guide Page 63
Query results using SUM function for Posted Total Amount provides a total amount for each account.
Query results using COUNT function for Accounts provides the number of accounts for each Business Unit and Ledger. The Sum for the Total Amount Posted adjusts to provide a total for all the accounts.
Page 64 SpearMC – Query Manager Training Guide
Query results using MIN function for Total Amount Posted provides the minimum total amount posted for each account.
Query results using MAX function for Total Amount Posted provides the maximum total amount posted for each account.
SpearMC – Query Manager Training Guide Page 65
Query results using AVERAGE function for Total Amount Posted provides the average total amount posted to each account.
Page 66 SpearMC – Query Manager Training Guide
DELETING FIELDS
Delete fields from a query using the Fields Page. Select the delete icon for the field to be removed. Deleting a field does not remove it from any Expressions, Prompts, Criteria, or Having Criteria defined for the query.
SpearMC – Query Manager Training Guide Page 67
CHAPTER 6 WORKING WITH CRITERIA Running a query without criteria returns all the data contained in the fields selected. Adding criteria refines the query by adding instructions to the query to filter the data. Use criteria to compare values of two separate fields, or to compare the data in a field to a constant value. Data is filtered by comparing the data in one expression with data in a second expression.
DEFINING CRITERIA
Add or edit criteria using the Criteria Page, or by selecting the criteria icon from the Fields Page or Query Page. Criteria definitions compare two different expressions. Expression 1 is defined then compared to the definition of Expression 2. Expression 1 is the data that is being filtered; Expression 2 provides the comparison data.
DEFINE CRITERIA
Define the data or expression to be filtered: Expression 1. Select the Condition Type Define the comparison data: Expression 2
Page 68 SpearMC – Query Manager Training Guide
Defining Expression 1: Filter Data
Field: If the data being filtered is contained in a record, use the Field option to define Expression 1. Use the Lookup Tool to search for a field used in the query.
Expression: If the data being filtered is based on an expression, select the Expression option.
Finding an Existing Expression: Use the Lookup Tool to search for previously defined expressions within the query. There may be instances when an expression created in the Expressions Page is also a part of the query filter. For instance, a query is needed to compare the sums of amounts from different records. The expression for the sums of the individual amounts would be defined on the Expressions Page. The results of the expressions are needed on the Criteria Page to build the filter.
Edit Expression: Use the Lookup Tool to search for an existing expression. Use Edit Expression to open and edit a previously defined expression.
New Expression: Select New Expression to open the Expressions Page and define a new expression
SpearMC – Query Manager Training Guide Page 69
Defining Condition Type
The Condition Type is the comparison operator between the two expressions. The Condition Type selected determines the type of expression created in Expression 2.
Between: The value of Expression 1 falls between and includes the two values defined in Expression 2.
Not Between: The value of Expression 1 does not fall between and does not include the two values defined in Expression 2.
The values of Expression 2 for the Between conditions are presented in one of the following combinations:
Const – Const: Defines two constant values.
Const – Field: Defines the first value as a constant and the second a field value.
Const – Expr: Defines the first value as a constant and the second value as an expression.
Field – Const: Defines the first value as a field and the second value as a constant.
Field – Field: Defines both values as fields.
Field – Expr: Defines the first value as a field and the second value as an expression.
Expr – Constant: Defines the first value as an expression and the second value as a constant.
Expr – Field: Defines the first value as an expression and the second value as a field.
Expr – Expr: Defines the both values as expressions.
Equal To: The value of Expression 1 is exactly the value of Expression 2.
Not Equal To: The value of Expression 1 does not exactly match the value of Expression 2.
Exists: The value of Expression 1 is contained in a subquery. All records matching are retrieved.
Does Not Exist: The value of Expression 1 is not contained in a subquery. All records not contained in the subquery are retrieved.
Greater Than: The value of Expression 1 is greater than the value of Expression 2.
Page 70 SpearMC – Query Manager Training Guide
Not Greater Than: The value of Expression 1 is not greater than the value of Expression 2.
In List: The value of Expression 1 is in a list of values defined in Expression 2.
Not In List: The value of Expression 1 is not in a list of values defined in Expression 2.
In Tree: The value of Expression 1 is a node in a tree created with Tree Manager. Expression 2 is a tree or branch of a tree. Do not use trees containing a combination of dynamic details and range details. The results returned from trees with this combination of details may be inaccurate.
Not In Tree: The value of Expression 1 is a node in a tree created with Tree Manager. Expression 2 is not a tree or branch of a tree. Do not use trees containing a combination of dynamic details and range details. The results returned from trees with this combination of details may be inaccurate.
SpearMC – Query Manager Training Guide Page 71
Is Null: The field selected for Expression 1 does not have a value. Null is different from 0 in that 0 is considered a value. If this condition type is selected, Expression 2 will not be defined. Key fields, required fields, character fields, and numeric fields do not allow null values.
Is Not Null: The field selected for Expression 1 has a value. Null is different from 0 in that 0 is considered a value. If this condition type is selected, Expression 2 will not be defined.
Page 72 SpearMC – Query Manager Training Guide
Less Than: The value of Expression 1 is less than the value of Expression 2.
Not Less Than: The value of Expression 1 is not less than the value of Expression 2.
Like: The value of Expression 1 matches a string pattern defined in Expression 2. Expression 2 must contain a string of data containing wildcard characters.
Not Like: The value of Expression 1 matches a string pattern defined in Expression 2. Expression 2 must contain a string of data containing wildcard characters.
PeopleSoft recognizes % and _ as wildcard operators when working with LIKE comparisons.
% matches any string of zero or more characters. For example, “C%” matches any character string starting with “C.”
_ matches any single character. For example, “_ones” matches any five‐character string ending with “ones,” such as Jones or Cones.
SpearMC – Query Manager Training Guide Page 73
Defining Expression 2: Comparison Data
Expression Types for Expression 2 are active depending on the Condition Operator selected.
Field: If the comparison data is contained in a record, use the Field option to define Expression 2. Use the Lookup Tool to search for a field used in the query.
Expression: If the data being compared is based on an expression, select the Expression option and build the expression using SQL.
Add Prompt: Select Add Prompt if the expression will be calculated based on data entered by the user.
Add Field: Select to add a field to the expression.
Constant: Compares Expression 1 to a constant value.
Subquery: Compares Expression 1 to data returned in a subquery.
Prompt: Compares Expression 1 to user‐entered data in a prompt.
In List: Compares Expression 1 to a list of values. This option is only available when the Condition Operators In List or Not In List is selected.
Current Date: Compares the date value in Expression 1 to the current system date.
Tree Option: Compares Expression 1 to selected tree nodes. This option is only available when the Condition Operates In Tree or Not In Tree is selected.
Effective Sequence: Used on some effective‐dated records.
Page 74 SpearMC – Query Manager Training Guide
Working with Effective Dates
Effective Dates are used to provide a history of PeopleSoft data. When a new record is added or an existing record is updated, a new Effective Date is assigned to the record.
For queries, the Effective Date criteria are automatically defined if a record contains the Effective Date as a key field. The default criteria retrieves the most recent or current record.
Effective Date Condition Types
Defining Effective Date criteria requires the use of specific comparison operators. When an Effective Date is defined in Expression 1, the following Conditions Types are available:
Eff Date <: Retrieves records where the Effective Date is less than the value entered in Expression 2.
Eff Date <=: Retrieves records where the Effective Date is less than or equal to the value entered in Expression 2.
Eff Date >: Retrieves records where the Effective Date is greater than the value entered in Expression 2.
Eff Date >=: Retrieves records where the Effective Date is greater than or equal to the value entered in Expression 2.
First Effective Date: Retrieves the first instance of the record entered.
Last Effective Date: Retrieves the last instance of the record entered.
SpearMC – Query Manager Training Guide Page 75
Effective Date Comparison Data
The Effective Date can be compared to a field, expression result, constant value, or the current date. Define Expression 2 using one of the following options:
Field: Compares a date field from a record with the Effective Date in Expression 1. Use this option to retrieve records that were effective on the same date as another record.
Expression: Compares the results of an expression with the Effective Date in Expression 1.
Constant: Compares the Effective Date in Expression 1 against the date entered in Expression 2. Use this option to retrieve data as of a certain date.
Current Date: Compares the Effective date in Expression 1 against the current system date.
WORKING WITH MULTIPLE CRITERIA
As criteria are added to the query, Query Manager compiles the criteria relationships using standard Logical Operators. Use the Criteria Page to display and edit the logic of criteria relationships.
Page 76 SpearMC – Query Manager Training Guide
Joining Multiple Criteria Statements
Criteria statements are created individually for a field and joined to create the overall logic for the query. As criteria are created, Query Manager joins the statements using the AND logic operator. Logical Operators between criteria statements are displayed and updated on the Criteria Page. The first criteria statement will not display an operator.
AND: Retrieves records where all criteria conditions are met.
AND NOT: Retrieves records meeting the condition of the previous criteria but omits records meeting the next condition.
OR: Retrieves records where any of the conditions are met.
OR NOT: Retrieves any records meeting the conditions of the previous criteria and any records that do not meet the next conditions.
Build NOT statements into the criteria statements rather than using a NOT operator to join multiple criteria. When NOT is used to join criteria statements, Query Manager cannot use SQL database indexes to speed up the search.
In the criteria statements above, the data will be evaluated and retrieved in the following manner:
1. Records will be searched for an effective date less than or equal to today’s date to pull the most recently updated record; and
2. Departments with a description beginning with ‘C’ will be retrieved; and 3. Departments with a description beginning with ‘D’ will be retrieved.
SpearMC – Query Manager Training Guide Page 77
The results for the query as it is presented will not retrieve any data because there are not any departments in the record with a description beginning with ‘C’ AND ‘D’. To update the statements to retrieve departments beginning with ‘C’ or ‘D’, change the logical operator between the last two statements by selecting OR from the drop‐down list. This will retrieve descriptions starting with a 'C' for the most current effective‐dated row, and all descriptions starting with a 'D', for all effective‐dated rows.
Page 78 SpearMC – Query Manager Training Guide
Reordering Criteria
Query Manager compiles the criteria relationships and evaluates statements in the order they are defined. When using multiple criteria, the statements may need to be reordered in order to apply grouping to the statements.
REORDER CRITERIA
Access the Edit Criteria Order Page using Reorder Criteria on the Criteria Page. Enter the order of evaluation in New Position.
SpearMC – Query Manager Training Guide Page 79
In the criteria statements above, the data will be evaluated and retrieved in the following manner:
1. Records will be searched for an effective date less than or equal to today’s date to pull the most recently updated record; and
2. Departments with an effective status of inactive will be retrieved; and 3. Departments with a description beginning with ‘C’ will be retrieved; or 4. Departments with a description beginning with ‘D’ will be retrieved.
The results for the query as it is presented will include departments beginning with ‘C’ and a status of inactive as of today’s date, and all departments beginning with ‘D’. The inactive status statement will not apply to the departments beginning with ‘D’ because the statements are not ordered and grouped properly. Before the criteria statements can be grouped, they may need to be reordered.
Page 80 SpearMC – Query Manager Training Guide
Grouping Criteria
Query Manager applies the criteria statements based on the rules of logic for the order of operations. Parentheses group the criteria statements to be evaluated first. AND statements are evaluated before OR statements. When using multiple types of logic operators in a query, apply grouping to ensure the statements are evaluated in the correct order.
GROUP CRITERIA
Access the Edit Criteria Grouping Page using Group Criteria on the Criteria Page.
Enter beginning parenthesis in the left entry field next to the first statement to be grouped.
Enter ending parenthesis in the right entry field next to the last statement to be grouped.
SpearMC – Query Manager Training Guide Page 81
In the criteria statements above, the data will be evaluated and retrieved in the following manner:
1. Departments with a description beginning with ‘C’ or ‘D’ will be retrieved; and 2. Records will be searched for an effective date less than or equal to today’s date to pull them
most recently updated record; and 3. Departments with an effective status of inactive will be retrieved.
The results for the query as it is presented will include departments beginning with ‘C’ or ‘D’ with an inactive status as of today’s date.
Page 82 SpearMC – Query Manager Training Guide
DEFINING DISTINCT CRITERIA
Queries retrieve all records meeting the criteria defined. In some instances, a single record will display multiple times because it meets the conditions of multiple criteria statements. To prevent the duplication of the same records in query results, define the query to retrieve only distinct data. Define distinct data using the Query Properties Page.
SpearMC – Query Manager Training Guide Page 83
EDITING CRITERIA
Access the Criteria Page to edit existing criteria statements. Select Edit for the criteria statement to open the Edit Criteria Properties Page.
Page 84 SpearMC – Query Manager Training Guide
DELETING CRITERIA
Access the Criteria Page to delete existing criteria statements. Select the delete icon for the criteria statement to remove it from the query logic. Deleting a criteria statement does not delete any fields or expressions defined for the query.
SpearMC – Query Manager Training Guide Page 85
CHAPTER 7BUILDING PROMPTS Prompts are fields presented to the user when a query is run. Prompts allow the user to define the parameters of the data needed rather than having the parameters defined as part of the criteria definition. Using prompts allows for the development of generic queries to be used by multiple workgroups rather than developing the same query for all workgroups with specific criteria.
CREATING PROMPTS
Prompts are created and edited by accessing the Edit Prompt Properties Page. The Edit Prompt Properties Page opens when Add Prompt or Edit is selected on the Prompts Page. Each prompt created appears when Add Prompt or Edit is selected on the Prompts Page. Each prompt created appears on the Prompts page and is identified by a system assigned Prompt ID and the defined prompt label.
Create a Prompt Define the field that will be filtered by the prompt.
Define the text label for the prompt
Define the prompt table to be used.
Add the prompt to a criteria statement.
Page 86 SpearMC – Query Manager Training Guide
Selecting Fields
Select the field name for the data to be filtered by the prompt using the Lookup Tool for Field Name. The remaining information on the form populate based on the database definition for the field selected.
Defining Prompt Label
The default prompt label displays in Heading Type. The heading type can be changed by selecting one of the following options from the drop‐down list.
RFT Short: The short description for the field.
RFT Long: The long description the field.
Text: A user‐defined label will display for the prompt. If selected, the user‐defined label is entered in Heading Text.
Defining the Prompt Table
A prompt table allows the use of a Lookup Tool when entering the values in the prompts. This offers a level of validation to insure the user is entering the correct data in the prompt. A field using a prompt table for data entry should also use a prompt table for query. If the field being filtered uses a prompt table at the database level, the type of table used will auto populate in Edit Type.
No Table Edit: The value entered in the prompt will not be verified for validity. The query will search for data as it is entered in the prompt.
Prompt Table: The value entered in the prompt is selected from an existing record. This would include items such as Project ID, Department ID, etc. A Lookup Tool appears with the prompt to assist users in selecting valid values.
Translate Table: The value entered in the prompt is selected from a predefined table set. This would include items such as ethnicity, sex, state abbreviations, etc. A Lookup Tool appears with the prompt to assist users in selecting valid values.
Yes/No Table: The value entered in the prompt is completed by selecting yes or no from a list of values.
The prompt table selected will depend upon the Edit Type for the field. If an Edit Type populates, use the Lookup Tool to find the appropriate prompt table to use. When the user accesses the prompt when running the query, the Lookup Tool provided will open the selected table.
SpearMC – Query Manager Training Guide Page 87
ADDING PROMPTS TO CRITERIA
In order to use prompts in running the report, the prompt needs to be added to the report criteria.
After creating a prompt, access the Criteria Page to add the prompt to the query. Create a criteria statement for a prompt by accessing the Criteria Page. Select Add Criteria, to build a criteria statement using a prompt.
For Expression 1, select the field that will be used to compare with the prompt. In the example below, a prompt was built to allow the user to search by a specific Project ID.
For Expression 2, select the Expression Type of Prompt. In the Expression 2 field, use the lookup tool to find the prompt built for Project ID. Select OK to save the criteria statement. Note: you may need to add a new prompt if one does not exist. For Project ID, you can use the following table to get a list of valid values for prompting: PROJECT_ID_VW.
Page 88 SpearMC – Query Manager Training Guide
The prompt criteria statement now appears on the Criteria Page. If a criteria statement does not appear for a prompt, the prompt will not display when the user accesses the query.
DELETING PROMPTS
Access the Prompts Page to delete existing prompts. Select the delete icon for the prompt to remove it from the query. Deleting a prompt does not delete any fields, expressions, or criteria defined for the query.
SpearMC – Query Manager Training Guide Page 89
CHAPTER 8 BUILDING EXPRESSIONS Expressions are calculations used to provide a value that is not a field in the database or formatting of query data using Structured Query Language (SQL). Calculations are defined using values from different fields or by constant values. The final formatted or calculated field is treated like any other field in a query. Use the Expressions Page to define calculations that will be used as additional fields in the query.
DEFINING EXPRESSIONS
The logic behind expressions is defined by accessing Edit Expression Properties Page. The Edit Expression Properties Page opens when Add Expression or Edit is selected on the Expressions Page.
Create an Expression Select Expression Type
Enter Maximum Length of Expression Result
Select Aggregate Function, if defining a calculation.
Enter the SQL statement in the Expression Text Field.
Select Add Field or Add Prompt to select the field for the expression.
Page 90 SpearMC – Query Manager Training Guide
FORMAT FOR EXPRESSION TEXT FUNC (Fieldname)
FUNC is the action that will be taken on the field.
Fieldname is the name of the field from the query that will be affected by the function.
Separate FUNC and Fieldname with parenthesis.
Selecting Expression Type
Query Manager allows for expressions to be created using character, numbers, date, and aggregate functions. Determine the data format for the expression and select the appropriate Expression Type from the drop‐down list.
Expression Type corresponds with the data format of the fields used in the expression and the end result of the expression. Field format and length definitions display on the Fields Page.
SpearMC – Query Manager Training Guide Page 91
Building Character Expressions
Select either Character or Long Character when building expressions using fields with a character format. Generally, character expressions are created to format data retrieved by the query.
BUILD A CHARACTER EXPRESSION Select either Character or Long Character from the Expression
Type drop‐down list.
Enter the maximum length of the expression result in Length.
Enter the SQL statement for the character expression in
Expression Text.
Select Add Field to apply the expression to a specific field in the query.
Create a character expression to format data consistently, combine two fields to display as one, add dollar signs and commas to numbers, and change date formats.
Query Prior to Adding Expression: Department ID and Description are displayed as two separate columns. The case for Description is inconsistent.
Page 92 SpearMC – Query Manager Training Guide
Expression Definition: Character length is defined for 45 characters. The length of the Department ID field is formatted for 10 characters and character length of the Description field is formatted for 30 characters. Additional length was added as padding for spacing. The result of the expression statement should be less than 45 characters. If the expression result is greater than the defined length, the data will truncate. The SQL statement for changing case and concatenating the fields has been added to the Expression Text field. Note: the expression may vary based on the database being accessed.
SpearMC – Query Manager Training Guide Page 93
Query After Applying Expression: Department ID and Description is displayed as one column in the query results. Department Description displays in uppercase.
Building Number Expressions
Select either Number or Signed Number when building expressions using fields with a number format. Create number expressions to calculate results between two number fields or to apply formatting to numeric data.
BUILD A NUMBER EXPRESSION
Select either Number or Signed Number from the Expression Type drop‐down list.
Enter the maximum length of the expression result in Length.
Enter the number of digits to appear after the decimal point in Decimal.
If building a calculation, select Aggregate Function.
Enter the SQL statement for the numeric expression in Expression Text.
Select Add Field to apply the expression to a specific field in the query.
Create a number expression to calculate numeric fields and format decimal placement.
Page 94 SpearMC – Query Manager Training Guide
Query Results Prior to Adding Expression: Total Amount is displayed with three digits behind the decimal place, and the amount is exact.
Expression Definition: Character length is defined for 12 characters and decimal placement is set to 2. If the result of the expression is greater than 12 digits, the data will truncate. The SQL statement for rounding the number is defined in Expression Text.
SpearMC – Query Manager Training Guide Page 95
Query Results After Applying Expression: The Total Amount is displayed with two digits behind the decimal and rounded to the next whole dollar.
Page 96 SpearMC – Query Manager Training Guide
Building Date Expressions
Select Date, Datetime, or Time to build expressions using fields with a date format. For PeopleSoft, dates are predefined at the database level to display to the user in the DD/MM/YYYY format. For every query containing a date, the date is automatically converted to a character format. Proper functioning of date expressions is limited.
BUILD A DATE EXPRESSION
Select Date, Datetime, or Time from the Expression Type drop‐down list.
Enter the maximum length of the expression result in Length.
Enter the SQL statement for the date expression in Expression Text.
Select Add Field to apply the expression to a specific field in the query.
Create a date expression to display the current date in a query by entering SYSDATE in the Expression Text. Note: this function may vary by database.
SpearMC – Query Manager Training Guide Page 97
DEFINING AGGREGATE FUNCTIONS
The Expressions Page allows the use of Aggregate Functions in performing calculations. An aggregate function returns a summary of the results of the query rather than each individual row.
BUILD AN AGGREGATE FUNCTION
Select the Expression Type based on the format of the fields being used.
Enter the maximum length of the expression result in Length.
Select the Aggregate Functions checkbox.
Enter the appropriate function statement in the Text Box.
Select Add Field to add fields to the function statement.
SUM: Provides a total for the selected field. The Sum function is used for numeric fields.
Page 98 SpearMC – Query Manager Training Guide
AVG: Provides the average of the selected field. The Avg function is used for numeric fields.
COUNT: Use to provide a count of all rows satisfying the criteria.
SpearMC – Query Manager Training Guide Page 99
MAX: Provides the largest figure in the selected field.
Page 100 SpearMC – Query Manager Training Guide
MIN: Provides the smallest figure in the selected field.
Add Field
When creating an Expression, select the Add Field command to select the field or fields used in the expression. If using an SQL command or an Aggregate Function, add parenthesis around the field name.
Add Prompt
Expression can be built using prompts. The prompt expression compares the data entered by the user.
SpearMC – Query Manager Training Guide Page 101
ADDING EXPRESSIONS TO CRITERIA
The results of an expression can be used to define criteria statements. Criteria statements using expressions are defined on the Having Criteria Page. Having Criteria causes the expression statement to be evaluated prior to applying the criteria statement to the query.
DELETING EXPRESSIONS
Remove an expression from a query using the delete icon on the Expressions Page. Deleting an Expression does not delete a record or field from a query. However, if the expression is used as part of a criteria statement, the criteria statement will be deleted.
Page 102 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 103
CHAPTER 9 – BUILDING SUBQUERIES A subquery is a subset of data used by a main query for data comparisons. The subquery contains data with specified criteria. The main query uses the results of the subquery as comparison data. Use subqueries when the data being retrieved has complex criteria requirements. For instance, a subquery can be created to isolate only active departments for a set of financial data containing numerous calculations.
DEFINING A SUBQUERY
Subqueries are defined on the Edit Criteria Properties page when the Subquery option is chosen as the Expression Type for Expression 2. Select Define/Edit Subquery to start the definition process.
Subqueries are built in the same manner as the main query using records, field, expressions, and criteria. Multiple Subqueries may be used in a single query, but each subquery contains only one field of data.
BUILD SUBQUERY
Create the main query.
Add Criteria using a Subquery for Expression Type 2.
Select Define/Edit Subquery.
Create query.
Navigate back to main query
After defining the subquery, select Subquery/Union Navigation to display a hierarchical structure of the main query and all defined subqueries. Use Subquery/Union Navigation to return to the main query.
Page 104 SpearMC – Query Manager Training Guide
SubQuery Scenario
A query is needed to find Asset IDs which have an active Location.
Step 1: Build a Query using the view named ASSET_ALL_VW.
Step 2: Add the fields BUSINESS_UNIT, ASSET_ID, and LOCATION.
SpearMC – Query Manager Training Guide Page 105
Step 3: Create a criteria statement for Location using a Condition Type of ‘in list’. The Edit Criteria Properties Page displays. Chose ‘Subquery’ from the Expression 2 type. Select Define/Edit Subquery to open the Records Page and start building a subquery.
Step 4: To isolate those Asset IDs without an active Location, create a subquery using LOCATION_TBL.
Page 106 SpearMC – Query Manager Training Guide
Step 5: Select the LOCATION field as your output, then add the criteria to indicate that the value should be active.
Step 6: Select Subquery/Union Navigation to navigate back to the main query.
SpearMC – Query Manager Training Guide Page 107
Step 7: In the main query, your criteria statement should indicate that you only want to see Asset IDs which have locations ‘in list’ from the results of your subquery.
Page 108 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 109
CHAPTER 10BUILDING LIST OF VALUES Build a List of Values when the In List and Not In List condition types are used in criteria definitions. A List of Values is a static list of data defined as part of the query criteria. In List values can be defined using existing data values or by entering values. The criteria filters data to items listed.
DEFINING LIST OF VALUES
The logic behind a List of Values is defined on the Edit Criteria Properties Page. The Edit Criteria Properties Page opens when Add Criteria or Edit is selected on the Criteria Page.
DEFINE IN LIST VALUES
Access Edit Criteria Properties Page
Define Expression 1
Select Condition Type of In List or Not In List
Select In List for Expression 2
Select the Lookup Tool to define the value list
Page 110 SpearMC – Query Manager Training Guide
Adding Values to a List
Define values for a list using the Edit List Page. When defining a list for a field populated by predefined data, the Edit List Page will display the data used to populate the field. If the field does not have predefined data, values are entered manually. Access Edit List using the Lookup Tool.
Predefined Value List
When a field has existing values in the database, they will be displayed on the Edit List Page. Select Add Value for each item to include in the list.
SpearMC – Query Manager Training Guide Page 111
If the field is populated by a table, the values from the table display when the Lookup Tool is selected.
Page 112 SpearMC – Query Manager Training Guide
User Defined Values
When a field does not have predefined values, the user determines the data to display in the list of values. Enter the data in Value and select Add Value to define the list.
Adding A Prompt
Select Add Prompt to add a prompt to the In List expression. The prompt will use the value entered in the prompt by the user in addition to the defined list to filter data.
Note: the prompt has to be added first before it can be used here.
SpearMC – Query Manager Training Guide Page 113
DELETING LIST OF VALUES
To delete a value, select the check box to the left of the appropriate List Members value and click the Delete Checked Values button. To delete the entire In List statement, navigate to the Criteria Page and select the Delete icon for the In List Criteria statement.
Page 114 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 115
CHAPTER 11 UNDERSTANDING JOINS Joins allow data to be retrieved from multiple records in a single query. Records are joined by common fields from one or more records. Query Manager allows users to create hierarchy, related record, any record, outer, and left outer joins.
CREATING HIERARCHY JOINS
A Hierarchy Join creates a relationship between a parent and child record. A child record contains all the key fields contained in the parent record, plus additional key fields. Parent/child record relationships are predefined at the database level. When a Hierarchy Join is selected, the data relationship is automatically established based on the common fields.
Use a Hierarchy Join to relate a general information record with records containing detail information. For example, one record may contain general project information, but another record may contain detail information regarding projects. A Hierarchy Join allows information to be combined and retrieved from both records. Create Hierarchy Joins using the Query Page.
CREATE A HIERARCHY JOIN
Add a Record to the Query.
Select the fields from the first record.
Select Hierarchy Join.
Select the parent or child table to join.
Select the fields from the second record.
Page 116 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 117
DELETING HIERARCHY JOINS
Remove Hierarchy Joins by selecting the Delete icon for the record on the Query Page. Deleting the record removes the join, fields, and criteria defined using the record.
CREATING RELATED RECORD JOINS
A Related Record Join creates a relationship between two records with a field in common. The relationship between the records is defined at the database level. When a Related Join link is selected, the data relationship is automatically established based on the common field.
Use a Related Record Join to relate code information with descriptive information. For example, one record contains the field Department ID, but another record contains the Department ID Description. A Related Record Join retrieves both the Department ID and Description. Create Related Record Joins using the Query Page.
CREATE A RELATED RECORD JOIN
Add a Record to the Query
Select the fields from the first record.
Select join link for the desired field.
Select the type of join to be created.
Delete Icon
Page 118 SpearMC – Query Manager Training Guide
Selecting Join Type
When defining a Related Record Join, Query Manager automatically determines which fields in the two tables are related. The user is given the flexibility to define the type of join to be created. When the Related Record Join link is selected for a field, the Join Page opens and two options are presented: Standard Join and Left Outer Join.
SpearMC – Query Manager Training Guide Page 119
Standard Join
A Standard Join is also referred to as an Inner Join. Data from both records combine to form a single query. The query retrieves information from both records where the joined fields match. The field creating the join displays as part of the record description on the Query Page.
Page 120 SpearMC – Query Manager Training Guide
Left Outer Join
A Left Outer Join retrieves all the data in the first record and only matching data from the second record. The query will retrieve only records from the second record if the joined fields match. The field creating the join will display as part of the record description on the Query Page. Use a Left Outer Join when querying for data from one table that may have relevant data in another. For example, a journal entry will have data in the financial tables, but may also have relevant information in a project table.
Creating a Left Outer Join will retrieve all information contained in the financial table and all relevant information contained in the project table.
SpearMC – Query Manager Training Guide Page 121
DELETING RELATED RECORD JOINS
Remove Related Record Joins by selecting the Delete icon for the record on the Query Page. Deleting the record removes the join, fields, and criteria defined using the record.
CREATING ANY RECORD JOINS
An Any Record Join creates a relationship between any two records in the database regardless of related fields of data. When adding new records to a query, the Any Record Join is established based on common fields for the records.
Any Record Joins rely on the use of criteria, defined either automatically or manually, in order to create a join. The criteria statements created to join the records, will display on the Criteria Page.
Delete Icon
Page 122 SpearMC – Query Manager Training Guide
Enabling Auto Join
The Auto Join feature in Query Manager determines if Any Record Joins are created automatically or manually. Auto Join preferences are defined for Query Manager by accessing the Query Preferences Page.
If Enable Auto Join is selected, Query Manager finds the predefined record relationship. If a relationship cannot be determined or Enable Auto Join is not selected, define a manual join to associate the two records.
SpearMC – Query Manager Training Guide Page 123
Creating Any Record Joins Automatically
CREATE AN ANY RECORD JOIN ‐ AUTOMATICALLY
Add a New Record to the Query
Select the type of join to be created.
Select the record to be joined.
Select or define joining criteria
Query Manager attempts to create Any Record Joins automatically when Enable Auto Join is selected in Query Preferences. When a new record is added to a query, the user is prompted to select a Join Type and the record to join.
After selecting the Join Type and Record to join, Query Manager presents a list of common fields to be used as join criteria. The joins presented may be selected or deselected as part of the query criteria.
Page 124 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 125
Creating Any Record Joins Manually
CREATE AN ANY RECORD JOIN MANUALLY
Add a New Record to the Query.
Select the type of join to be created.
Select the record to be joined.
Define criteria on Criteria Page.
When Enable Auto Join is not selected in Query Preferences, the user will create a record join by defining criteria on the Criteria Page. When a new record is added to a query, the user is prompted to select a Join Type and the record to join. When the join procedure is complete, define criteria on the Criteria Page. The purpose of the join criteria is to identify matching fields in the records to obtain associated data. Create an equals criteria statement using the fields that are the same in both records.
Selecting Join Type
When defining a Related Record Join, Query Manager will automatically determine which fields in the two tables are related. The user is given the flexibility to define the type of join to be created. When the Related Record Join link is selected for a field, the Join Page is opened and two options are presented: Standard Join and Left Outer Join.
Page 126 SpearMC – Query Manager Training Guide
Standard Join
A Standard Join is also referred to as an Inner Join. Data from both records are combined to form a single query. The query will retrieve the information from both records if the joined fields match. The field creating the join will display as part of the record description on the Query Page.
SpearMC – Query Manager Training Guide Page 127
Left Outer Join
A Left Outer Join retrieves all the data in the first record and only matching data from the second record. The query will retrieve only records from the second record if the joined fields match. The field creating the join will display as part of the record description on the Query Page. Use a Left Outer Join when querying for data from one table that may have relevant data in another. For example, a journal entry will have data in the financial tables, but may also have relevant information in a project table. Creating a Left Outer Join will retrieve all information contained in the financial table and all relevant information contained in the project table.
Page 128 SpearMC – Query Manager Training Guide
Defining Join Criteria
When a manual join is created to relate tables, define the join criteria using the Edit Criteria Properties Page. Create an ‘equals’ equation between a field common to each record.
Deleting Any Record Joins
Remove Any Record Joins by selecting the Delete icon for the record on the Query Page. Deleting the record removes the join, fields, and criteria defined using the record.
SpearMC – Query Manager Training Guide Page 129
CHAPTER 12 SAVING QUERIES
The save function in Query Manager allows users to save queries for use at future dates. In addition, a copy of a public query may be saved when a user needs to make modifications to an existing query.
SAVE A QUERY
Select Save or Save As
Define Query Name
Define Description
Define Folder
Define Query Type
Define Owner
Provide Query Definition
Page 130 SpearMC – Query Manager Training Guide
SAVING A NEW QUERY
Select Save to commit a new query to the PeopleSoft database. For new queries, selecting Save opens the Save Page.
SAVING CHANGES
Select Save to commit modifications made to a query. Selecting Save overwrites the query automatically.
SAVING A COPY
Select Save As to save a copy of the existing query. Use Save As when the original query needs to remain intact. Selecting Save As opens the Save Page.
Use the standard query naming conventions defined in Chapter 14 when creating, saving, and renaming queries.
SpearMC – Query Manager Training Guide Page 131
CHAPTER 13 RUNNING QUERIES
Query results can be viewed, printed, and saved from a number of formats. PeopleSoft Query allows results to be accessed as an HTML document or Excel Spreadsheet. Some queries will execute immediately upon selecting an option; others will prompt the user for input before running the query.
USING PROMPTS
Prompts are used to narrow query results. Prompts require data be entered before a query will run. After the requested data has been entered, View Results command is used to display the data. Date prompts offer a calendar icon for users to select a date. Table Prompts offer a Lookup Tool for entering criteria.
Queries using prompts will display in the web browser before allowing the user to open or save the file to Excel.
Page 132 SpearMC – Query Manager Training Guide
RUNNING TO HTML
Selecting the link Run to HTML will display query results in a new web browser page. The query results can be printed or saved using the browser’s tool bar functionality. Data viewed in HTML format cannot be edited or modified.
Downloading Results to Excel
Select Excel Spreadsheet to download or view the query results in spreadsheet format from the HTML preview. Download or open the results as an Excel file when the query has returned less than 65,536 rows of data.
Excel spreadsheets can contain a maximum number of 65,536 rows. If the spreadsheet cannot include all of the rows in your query then the first row will display – in a red font – the total number of rows of your query that are included in the spreadsheet.
Select open to view the results in Excel format. The results are displayed in a spreadsheet within the web browser.
SpearMC – Query Manager Training Guide Page 133
To edit the spreadsheet data while information is displayed in the web browser, select View >Toolbars to access toolbar commands for Excel.
Select Save to download the results as an Excel file. Provide a unique name for the file. When the download is complete, the file can be opened in Excel.
Page 134 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 135
Page 136 SpearMC – Query Manager Training Guide
Downloading Results to CSV Text File
Select CSV Text file to download the results in text format. The CSV Text file will open in Excel. Use the CSV Text format when returning large datasets in the query results. CSV Text removes formatting from the query results before presenting it as a file. The text file can be formatted, modified, saved, and used as attachments in email.
Select open to view the results in Excel with the CSV Text format. The results are displayed in a spreadsheet within the web browser.
To edit the spreadsheet data while information is displayed in the web browser, select View >Toolbars to access toolbar commands for Excel.
SpearMC – Query Manager Training Guide Page 137
Select Save to download the results as an Excel file. Provide a unique name for the file. When the download is complete, the file can be opened in Excel.
Page 138 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 139
RUNNING TO EXCEL
Select the Run to Excel provided in query search results to send the query results directly to Excel. From Excel, the data can be manipulated, sorted, and formatted. Excel spreadsheets can contain a maximum number of 65,536 rows. If the spreadsheet cannot include all of the rows in your query then the first row will display – in a red font – the total number of rows of your query that are included in the spreadsheet.
Queries using prompts will display in the web browser before allowing the user to open or save the file to Excel.
Select open to view the results in Excel format. The results are displayed in a spreadsheet within the web browser.
To edit the spreadsheet data while information is displayed in the web browser, select View >Toolbars to access toolbar commands for Excel.
Page 140 SpearMC – Query Manager Training Guide
Select Save to download the results as an Excel file. Provide a unique name for the file. When the download is complete, the file can be opened in Excel.
SpearMC – Query Manager Training Guide Page 141
Page 142 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 143
PREVIEWING
When building a query, results can be previewed using the Run Page in Query Manager. Use the Run Page when building a query to view query results. Results can also be downloaded to Excel using the Run Page.
Enabling Auto Preview
If Auto Preview is enabled, a query will refresh each time the Run Page is accessed. Otherwise, the user will select Rerun Query in order to see results after changes are made to the query. Enable Auto Preview by accessing Preferences and selecting Enable Auto Preview.
Disabling Auto Preview leaves the query results displayed on the Preview Page. This is useful when building queries. Users can use the previewed data as a reference when creating and modifying queries.
Page 144 SpearMC – Query Manager Training Guide
SpearMC – Query Manager Training Guide Page 145
Rerun Query
If Auto Preview is not enabled, select the Rerun Query link to refresh the query preview each time changes are made to the query logic.
Page 146 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 147
CHAPTER 14– FINANCIALS DESKTOP REFERENCE
DEFINING EXCEL FILE TYPES
Some desktop computers may not have Excel file types defined properly for PeopleSoft Query downloads. Follow the steps below to instruct the query to open in Excel when ‘Download to Excel’ is selected.
1. Navigate to Control Panel from the Start Menu.
Page 148 SpearMC – Query Manager Training Guide
2. Access Folder Options and navigate to File Types tab. Highlight XLS (Microsoft Excel Worksheet) and select Advanced.
3. Remove the checkmarks for Confirm open after download and Browse in same window. Select OK.
SpearMC – Query Manager Training Guide Page 149
PLANNING GUIDE FOR BUILDING QUERIES Plan the Query
Select Records
Select Fields
Define Criteria
Preview and validate results
Save
Understanding the data and how it is stored in the database is an important aspect of building queries. Before creating a query for data to be published or distributed, become familiar with the data, including where it is entered by the user, where it is stored on the database, and the data relationships. Take time to design the query. Identifying some of the common elements will save time and alleviate any frustrations that may arise.
1. Identify the purpose of the query. What is it going to do, who is the audience, what is the purpose of the data being retrieved. Summarize the query in a couple of statements to provide focus during the process.
2. Identify information to be included in the query. Which fields and records will be used? Review the pages where users enter data. Selecting Ctrl+J while in a data entry page displays the record address for the data. Be careful, as this is not always the final location for the data, but it is a start for tracing fields and records.
3. Define any expressions, calculations, or functions needed. Are there any calculations or formatting requirements? Query Manager is capable of using simple SQL code.
4. Identify filter criteria and prompts. Will the query be used by all business units? Can the results be limited to a date range or department?
5. Validate the Query. When the query is complete, take the time to review and verify the data before using or distributing any information obtained by a query.
Page 150 SpearMC – Query Manager Training Guide
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐INTENTIONALLY LEFT BLANK‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
SpearMC – Query Manager Training Guide Page 151
APPENDIX – TABLES USED FOR REPORTING General Ledger – PS_LEDGER General Ledger – PS_JRNL_HEADER BUSINESS_UNIT BUSINESS_UNIT
LEDGER JOURNAL_ID
All chartfields JOURNAL_DATE
FISCAL_YEAR UNPOST_SEQ
ACCOUNTING_PERIOD
General Ledger – PS_JRNL_LN General Ledger – PS_GL_ACCOUNT_TBL BUSINESS_UNIT SETID
JOURNAL_ID ACCOUNT
JOURNAL_DATE EFFDT
UNPOST_SEQ JOURNAL_LINE LEDGER
General Ledger – PS_DEPT_TBL General Ledger – PS_OPER_UNIT_TBL SETID SETID
DEPT_ID OPERATING_UNIT
EFFDT EFFDT
Accounts Payable PS_VENDOR Accounts Payable PS_VENDOR_ADDR SETID SETID
VENDOR_ID VENDOR_ID
ADDRESS_SEQ_NUM
EFFDT
Accounts Payable PS_VOUCHER Accounts Payable PS_VOUCHER_LINE BUSINESS_UNIT BUSINESS_UNIT
VOUCHER_ID VOUCHER_ID
VOUCHER_LINE_NUM
Page 152 SpearMC – Query Manager Training Guide
Accounts Payable PS_VCHR_ACCTG_LINE
Accounts Payable PS_DISTRIB_LINE
BUSINESS_UNIT BUSINESS_UNIT
VOUCHER_ID VOUCHER_ID
UNPOST_SEQ VOUCHER_LINE_NUM
APPL_JRNL_ID DISTRIB_LINE_ NUM
POSTING_PROCESS Purchasing – PS_PO_HDR PYMNT_CNT BUSINESS_UNIT
VOUCHER_LINE_NUM PO_ID
DISTRIB_LINE_NUM DST_ACCT_TYPE Purchasing – PS_PO_LINE CF_BAL_LINE_NUM BUSINESS_UNIT
LEDGER PO_ID
TAX_AUTHORITY_CD LINE_NBR
Purchasing – PS_PO_LINE_DISTRIB Receivables – PS_CUSTOMER BUSINESS_UNIT SETID PO_ID CUST_ID
LINE_NBR SCHED_NBR DST_ACCT_TYPE DISTRIB_LINE_NUM
Receivables – PS_PENDING_ITEM Receivables – PS_PENDING_DST GROUP_BU GROUP_BU
GROUP_ID GROUP_ID
BUSINESS_UNIT BUSINESS_UNIT
CUST_ID CUST_ID
ITEM ITEM
ITEM_LINE ITEM_LINE
GROUP_SEQ_NUM GROUP_SEQ_NUM
LEDGER_GROUP
LEDGER
DST_SEQ_NUM
SpearMC – Query Manager Training Guide Page 153
Receivables – PS_PAYMENT Receivables – PS_PAYMENT_ITEM DEPOSIT_BU DEPOSIT_BU
DEPOSIT_ID DEPOSIT_ID
PAYMENT_SEQ_NUM PAYMENT_SEQ_NUM
BUSINESS_UNIT
CUST_ID
ITEM
ITEM_LINE
AR_SEQ_NUM
Receivables – PS_ITEM Receivables – PS_PAYMENT_ID_ITEM BUSINESS_UNIT DEPOSIT_BU
CUST_ID DEPOSIT_ID
ITEM PAYMENT_SEQ_NUM
ITEM_LINE ID_SEQ_NUM
Receivables – PS_WS_ITEM Receivables – PS_ITEM_DST WS_BU BUSINESS_UNIT
WS_ID CUST_ID
SUB_GROUP_ID ITEM
BUSINESS_UNIT ITEM_LINE
CUST_ID ITEM_SEQ_NUM
ITEM LEDGER_GROUP
ITEM_LINE LEDGER
WS_SEQ DST_SEQ_NUM
Billing – PS_BI_HDR BUSINESS_UNIT INVOICE
Billing – PS_BI_LINE_DST Billing – PS_BI_LINE BUSINESS_UNIT BUSINESS_UNIT
INVOICE INVOICE
LINE_SEQ_NUM LINE_SEQ_NUM
LINE_DST_SEQ_NUM