Albertsons PSQuery Basic
Albertsons PSQuery Basic
PeopleSoft Query
Introduction
August 2018
1
Agenda
What is PeopleSoft Query
– Relational Database
– PS Query Terms
– PeopleSoft HRMS Tables/Records
– Query Security
Running Existing Queries
– Searching Existing Queries
– Existing Query Command Options
Creating New Queries
– Organizing and Managing Queries
– Edit Existing Queries
– Selecting Records
– Adding Fields
– Ordering and Sorting Column Data
– Editing Field Properties
– Viewing Underlying SQL Code
– Filtering Output with Criteria
– Previewing Query Results
– Making a Query Distinct
– Saving Queries
– Adding a Runtime Prompt
2
What is PeopleSoft (PS) Query
PeopleSoft Query or PS Query is an end-user reporting
tool that allows Query Developers to extract information in
the form of a query from the relational database, without
the need to write SQL (Structured Query Language)
statements. Queries can be simple or quite complex; they
may be used one time or repeatedly, as necessary.
Results can be displayed on a page or sent to Excel,
HTML, XML or scheduled to run at a later time. In its
simplest form a query is basically a compilation of data
from certain fields displayed in the way the user has
selected.
3
Relational Database
A relational database is a way of storing information
that organizes data into tables. Though table is the
term traditionally used they are referred to as 'Records'
in PS Query and they consist of columns and rows
(imagine an Excel Spreadsheet). The columns
represent fields and the rows detail each instance of
stored information. For example, a column or field
name might be 'Name' while the row information would
hold ‘Karl', 'Sophia', 'Olivia', 'Drake', etc. Records can
be linked by creating a defined relationship. These
relationships enable you to retrieve and combine data
from one or more Records with a single Query. They
are based on key fields, or columns that uniquely
identify each row of data. If a database only has a
single record it is referred to as a flat database but if
there are two or more records which can be related it is
called a relational database.
4
PS Query Terms
Below is a list of most of the terms that users will come across in their experiences with PS Query.
– Relational Database: A database system in which the database is organized and accessed according to the relationships between
data items without the need for any consideration of physical orientation and relationship. Relationships between data items are
expressed by means of tables (records).
– Record/Table: Records/Tables are the foundation of the query tool. A record stores data that is arranged by rows (entries) and columns
(fields). For example, a record/table containing data about “people” would have a row for each individual person and columns (fields) for
each piece of data stored for that individual (ex: name, address, phone). Records can be added to a query from the “Records” tab.
– Column/Field: In a database context, a field is the same as a column. For example, a record of people could contain separate fields
such as name, address, phone, etc.
– Query: A query is a SQL SELECT statement that reads data from records and views within the database, and returns the result set to
the requester. PS Queries cannot change data within the database.
– SQL: Structured Query Language (SQL) is a language that provides an interface to relational database systems. It was developed by
IBM in the 1970s for use in System R. SQL is a de facto standard, as well as an ISO and ANSI standard. Some people pronounce SQL
"sequel".
– Criteria: Specifying criteria in your query allows you to set conditions which limit the results returned by the query to only those data
that you are interested in. Criteria are viewed and maintained on the “Criteria” tab. Example: You may want to set criteria to limit your
query to retrieve a relevant subset of data such as active undergraduate students as opposed to returning results for all active students.
– Join: The process of combining data from two or more records using matching keys.
– Public Query: Public Queries are viewable and editable by any user with access to Query Manager and the proper Record access.
Public queries are available for use by many different users, so please do not save any changes that you make to a public query.
– Private Query: Private queries are only viewable by the individual who created the query. They can be shared with others individually,
however.
– Key Field: A column in a record whose values uniquely identify each row. A key field value cannot be NULL.
5
PeopleSoft HRMS Tables/Records
PeopleTools Tables – PeopleTools tables contain meta-data about the PeopleSoft applicaton.
– PSMENUDEFN – Menu Names
– PSPNLDEFN – Page Names
PeopleSoft Control Tables - Control tables store information that is used to process and validate the
day-to-day business activities (transactions) users perform with PeopleSoft HCM applications. The
information stored in control tables is common and shared across an organization, for example,
master lists of customers, vendors, applications, items, or charts of accounts. By storing this shared
information in a central location, control tables help to reduce data redundancy, maintain data
integrity, and ensure that users have access to the same basic information. The information stored in
control tables is generally static and is updated only when fundamental changes occur to business
policies, organizational structures, or processing rules.
– COMPANY_TBL
– LOCATION_TBL
PeopleSoft Transaction Tables - Transaction tables store information about the day-to-day business
activities (transactions) users perform with PeopleSoft HCM applications. The information stored in
transaction tables often changes and is updated more frequently than the information stored in control
tables
– JOB
PeopleSoft Prompt Tables - Prompt tables are tables that are associated with fields on PeopleSoft
application pages and which display valid data values for those fields when a user selects a prompt or
search option. The data values stored in prompt tables are retrieved from control tables, transaction
tables, or other PeopleSoft tables
6
Looking Up PeopleSoft Records
Look up Records using Entity relations diagrams (ERDs). This module is available in DEMO.
Entity relations diagrams (ERDs) capture the relationships between, details of, and constraints
imposed on the data defined in these models. ERDs provide a visual representation of the
database.
Demo - http://phvgqa88.safeway.com:10410/psp/HRPSQ4/EMPLOYEE/HRMS/?cmd=expire
7
Looking Up PeopleSoft Records - Continued
In this example we used the Department Component
Department ERD
8
Researching Fields using Query Manager
• Navigate to : NavBar
• Navigator
9
Researching Fields using Query Manager - Continued
10
Researching Fields using Query Manager - Continued
• Navigate to : Query
11
Researching Fields using Query Manager - Continued
12
Researching Fields using Query Manager - Continued
13
Researching Fields using Query Manager - Continued
14
Query Security
15
Running Existing Queries
Search for an existing query or report in PS environment
– Better to use an existing query than develop a new one.
– Minimizes query clutter.
– Query is already in production so it reduces wait time for the end-user.
Query Viewer enables you to:
– Search for a query.
– Preview a query in the active browser window.
– Run a query and display results in a new browser window.
– Print a query.
– Schedule a query.
16
Existing Queries using Query Viewer
17
Searching Existing Queries using Query
Viewer (Wildcards)
• Type %SUPER%
• % is a wildcard meaning anything
with SUPER will be displayed
• Click Search
18
Searching Existing Queries using Query
Viewer (Advanced)
• Click Advanced Search
19
Searching Existing Queries using Query
Viewer (Advanced)
20
Existing Queries Command Options
• Run to HTML
• Run to Excel
• Run to XML
• Schedule
• Definitional References
• Add to Favorites
21
Existing Queries - Run to HTML
• Click HTML
• The below report
will run and
display in
browser
• Note that from
browser, report
can be
downloaded
• Excel
Spreadsheet
• CSV/Text File
• XML File
22
Existing Queries - Run to Excel
• Click Excel
• Click Open
• Below Excel
will open with
data from
Query
23
Existing Queries - Run to XML
• Click XML
• Click Open
• Below XML will
open in
browser
24
Existing Queries – Schedule (Will be
covered in Advanced)
• Click Schedule
25
Existing Queries - Lookup References
Use the Definitional References to Query page (QRY_DEFN_REF) to view all PeopleSoft definitional objects that use this particular
query as the data source. The results show the definition ID, definition type, and definition sub-types if they are available.
These object types are included in the Definitional References to Query page:
• BI Publisher (with the Report Definition or Data Source Definition subtypes)
• Connected Query
• Composite Query
• Pivot Grid
• PeopleSoft Search Framework
• Cube Builder, Cube Outline, and Cube Dimension
• Query Feed and Query Feed Template
26
Existing Queries - Favorites
• Click Favorites
• My Favorite
Queries will
appear
27
Creating New Queries - Organizing and
Managing Queries
Use standard naming convention.
The Name field is 30 characters.
– ABS_XX_XXXXXXXX
• ABS for Albertsons
– ABS_PY_XXXXXXXX
• PY – Payroll
• AM – Absence Management
• BN - Benefits
• HR – Human Resources
• LA – Labor Agreements
– Example: ABS_HR_HEADCOUNT
Add description to query property.
– The Description field is 30
characters. Try to use a description
that will best identify the query and
will also facilitate searching
28
Query Manager
• Navigate to : NavBar
• Navigator
• Reporting Tools
• Query
• Query Manager
29
Edit Existing Queries
30
Creating New Queries – Selecting Records
• Type in Person
• Click Record Name
• Click Search
31
Creating New Queries – Selecting Records
Advanced
• Advance Filtering is
also available for each
type
32
Creating New Queries – Selecting Records
33
Creating New Queries – Adding Fields
34
Creating New Queries – Ordering and
Sorting Column Data
35
Creating New Queries – Edit Field
Properties
36
Creating New Queries – Viewing Underlying
SQL Code
37
Creating New Queries – Filtering Output
with Criteria
• Click Criteria Tab
• Click Add Criteria
• Click Record
Lookup
• Select A.BirthDate
38
Creating New Queries – Filtering Output
with Criteria
• Click Condition
Type Dropdown
• Select “is not null”
• Click ok
• Click ok
39
Creating New Queries – Filtering Output
with Criteria
40
Creating New Queries – Previewing Query
Results
41
Creating New Queries – Making a Query
Distinct
42
Creating New Queries – Making a Query
Distinct
• Click
Properties
• Click Distinct
• Click Save
43
Creating New Queries – Making a Query
Distinct
44
Creating New Queries – Saving Queries
• Click Save
• Enter Query Name
• Enter Query
Discription
• Choose Private or
Public
• Enter any notes in
Query Definition
• Click OK
45
Properties - Saving Queries
Query Types
User Query - User queries retrieve data from the
database directly from Windows-based Query Designer
or the web-based Query Manager and Query Viewer
applications.
Process Query - Process queries are queries that you
intend to run periodically using a batch process. Create
these automated batch processes using PeopleSoft
Application Engine and the Query API. For example, you
could write a query that returns any overdue receivables
and schedule a batch process to run the query once a
week.
Role Query - PeopleSoft Workflow uses role queries to
determine to whom to send an email, form, or worklist
entry. A role query needs to return one or more role IDs
based on the data that has been saved on the page that
is triggering the routing.
Archive Query - You can save a query as an archive
query if you have access to workflow queries that include
Archive Query, Role Query, and Process Query. These
queries are generally only used by the PeopleSoft Data
Archive Manager.
This Training Session will only cover Query Type User.
46
Creating New Queries – Adding a Runtime
Prompt
47
Creating New Queries – Adding a Runtime Prompt to run
report for just one employee id continued
• Enter EMPLID
• Click Search
• Click EMPLID
• Click Save
48
Creating New Queries – Adding a Runtime Prompt to run
report for just one employee id continued
49
Creating New Queries – Adding a Runtime Prompt to run
report for just one employee id continued
• Click Prompt
• Click the Prompt Lookup
• Select 1 = EMPLID
• Click OK
• Click Save
50
Creating New Queries – Adding a Runtime Prompt to run
report for just one employee id continued
51
Working with Multiple Tables
Query Manager enables you to create queries that include multiple-table joins.
Joins retrieve data from more than one table, presenting the data as if it came
from one table. PeopleSoft Query links the tables, based on common columns,
and links the rows on the two tables by common values in the shared columns.
Joins are what make relational databases relational. Using joins, you define
relationships among fields when you query the records, not when you create the
records. Because PeopleSoft records are highly normalized (they each describe
one kind of entity), you can easily use Query Manager to create joins.
The procedure for joining tables differs depending on how the tables that are
being joined are related to each other.
o This Training will only cover Standard Joins. A Standard Join displays a record when the data exists
in both Records
52
Working with Multiple Tables –
Implementing Standard Joins
53
Working with Multiple Tables –
Implementing Standard Joins
• Click Add Criteria
• Click OK
Understanding Effective Date
Criteria -
The highest effective date
(and possibly sequence number,
if used) is less than or equal to
today's date (system date on
the server).
This will be covered further in the
Advanced Training
54
Working with Multiple Tables – Effective
Dated Rows
55
Working with Multiple Tables –
Implementing Standard Joins
56
Working with Multiple Tables –
Implementing Standard Joins
57
Questions
58